/* WooCommerce Multiple Addresses Styles */


/* Order Summary Styles */
.wc-multiple-addresses-order-summary {
    margin: 30px 0;
    padding: 20px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    border-left: 4px solid #0073aa;
}

.wc-multiple-addresses-order-summary h3 {
    margin: 0 0 15px 0;
    color: #0073aa;
    font-size: 18px;
    font-weight: 600;
}

.wc-multiple-addresses-order-summary > p {
    margin: 0 0 20px 0;
    color: #666;
    font-size: 14px;
}

.addresses-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.address-summary-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.address-summary-card h4 {
    margin: 0 0 10px 0;
    color: #0073aa;
    font-size: 16px;
    font-weight: 600;
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
}

.address-summary-details {
    font-size: 13px;
    line-height: 1.4;
}

.address-summary-details p {
    margin: 0 0 5px 0;
    color: #333;
}

.address-summary-details p:last-child {
    margin-bottom: 0;
}

.address-summary-details strong {
    color: #0073aa;
    font-weight: 600;
}

/* Admin Order Detail Page Styles */
.wc-multiple-addresses-admin-section {
    margin: 20px 0;
    padding: 20px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    border-left: 4px solid #0073aa;
}

.wc-multiple-addresses-admin-section h3 {
    margin: 0 0 15px 0;
    color: #0073aa;
    font-size: 16px;
    font-weight: 600;
}

.wc-multiple-addresses-admin-section > p {
    margin: 0 0 20px 0;
    color: #666;
    font-size: 14px;
}

.admin-addresses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px;
}

.admin-address-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 15px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.admin-address-card h4 {
    margin: 0 0 10px 0;
    color: #0073aa;
    font-size: 14px;
    font-weight: 600;
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
}

.admin-address-details {
    font-size: 13px;
    line-height: 1.4;
}

.admin-address-details p {
    margin: 0 0 5px 0;
    color: #333;
}

.admin-address-details p:last-child {
    margin-bottom: 0;
}

.admin-address-details strong {
    color: #0073aa;
    font-weight: 600;
}

/* Meta Box Styles */
.meta-box-addresses {
    font-size: 13px;
}

.meta-box-address-item {
    margin-bottom: 15px;
    padding: 10px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.meta-box-address-item:last-child {
    margin-bottom: 0;
}

.meta-box-address-item h4 {
    margin: 0 0 8px 0;
    color: #0073aa;
    font-size: 13px;
    font-weight: 600;
    border-bottom: 1px solid #ddd;
    padding-bottom: 5px;
}

.meta-box-address-details {
    font-size: 12px;
    line-height: 1.3;
}

.meta-box-address-details p {
    margin: 0 0 3px 0;
    color: #333;
}

.meta-box-address-details p:last-child {
    margin-bottom: 0;
}

.meta-box-address-details strong {
    color: #0073aa;
    font-weight: 600;
}

/* Order Actions Section Styles */
.order-actions-addresses {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    border-left: 4px solid #0073aa;
}

.order-actions-addresses h4 {
    margin: 0 0 10px 0;
    color: #0073aa;
    font-size: 14px;
    font-weight: 600;
}

.order-actions-addresses p {
    margin: 0 0 15px 0;
    color: #666;
    font-size: 13px;
}

.order-actions-address-list {
    max-height: 200px;
    overflow-y: auto;
}

.order-actions-address-item {
    margin-bottom: 12px;
    padding: 10px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
    line-height: 1.3;
}

.order-actions-address-item:last-child {
    margin-bottom: 0;
}

.order-actions-address-item h5 {
    margin: 0 0 5px 0;
    color: #0073aa;
    font-size: 12px;
    font-weight: 600;
}

.order-actions-address-details {
    color: #333;
}

.order-actions-address-details p {
    margin: 0 0 2px 0;
    font-size: 11px;
}

.order-actions-address-details p:last-child {
    margin-bottom: 0;
}

.order-actions-address-details strong {
    color: #0073aa;
    font-weight: 600;
}

/* My Account Addresses Page */
.addresses-page {
    max-width: 1200px;
    margin: 0 auto;
}

.addresses-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.addresses-header p {
    margin: 0;
    color: #666;
    font-size: 14px;
}

.add-address-btn {
    background: #0073aa;
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    transition: background 0.3s ease;
}

.add-address-btn:hover {
    background: #005a87;
    color: #fff;
}

.no-addresses {
    text-align: center;
    padding: 60px 20px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 2px dashed #ddd;
}

.no-addresses p {
    margin: 0 0 20px 0;
    color: #666;
    font-size: 16px;
}

/* Address Grid */
.addresses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.address-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
}

.address-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.address-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
}

.address-header h3 {
    margin: 0;
    color: #333;
    font-size: 18px;
    font-weight: 600;
}

.default-badge {
    background: #0073aa;
    color: #fff;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.address-details {
    margin-bottom: 20px;
}

.address-details p {
    margin: 0 0 8px 0;
    color: #555;
    line-height: 1.5;
}

.address-details p:last-child {
    margin-bottom: 0;
}

.address-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.address-actions .button {
    padding: 8px 16px;
    font-size: 13px;
    border-radius: 4px;
    text-decoration: none;
    border: 1px solid #ddd;
    background: #fff;
    color: #333;
    transition: all 0.3s ease;
}

.address-actions .button:hover {
    background: #f8f9fa;
    border-color: #0073aa;
    color: #0073aa;
}

.edit-address-btn {
    background: #0073aa !important;
    color: #fff !important;
    border-color: #0073aa !important;
}

.edit-address-btn:hover {
    background: #005a87 !important;
    border-color: #005a87 !important;
    color: #fff !important;
}

.delete-address-btn {
    background: #dc3545 !important;
    color: #fff !important;
    border-color: #dc3545 !important;
}

.delete-address-btn:hover {
    background: #c82333 !important;
    border-color: #c82333 !important;
    color: #fff !important;
}

/* Address Forms */
.add-address-page,
.edit-address-page {
    max-width: 800px;
    margin: 0 auto;
}

.address-form {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.form-row {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
}

.form-row-first,
.form-row-last {
    width: 48%;
}

.form-row-wide {
    width: 100%;
}

.form-row label {
    margin-bottom: 5px;
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.form-row input,
.form-row select {
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-row input:focus,
.form-row select:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
}

.form-row.error input,
.form-row.error select {
    border-color: #dc3545;
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.2);
}

.field-error {
    color: #dc3545;
    font-size: 12px;
    margin-top: 5px;
    display: block;
}

.form-row small {
    color: #666;
    font-size: 12px;
    margin-top: 5px;
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.form-actions .button {
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 4px;
    text-decoration: none;
    border: 1px solid #ddd;
    background: #fff;
    color: #333;
    transition: all 0.3s ease;
    cursor: pointer;
}

.form-actions .button:hover {
    background: #f8f9fa;
    border-color: #0073aa;
    color: #0073aa;
}

.form-actions .button[type="submit"] {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
}

.form-actions .button[type="submit"]:hover {
    background: #005a87;
    border-color: #005a87;
    color: #fff;
}

/* Checkout Address Selection */
.checkout-address-selection {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    border: 1px solid #e0e0e0;
}

.checkout-address-selection h3 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 18px;
}

.checkout-address-selection p {
    margin: 0 0 20px 0;
    color: #666;
    font-size: 14px;
}

.address-requirement {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
    padding: 10px;
    border-radius: 4px;
    margin: 10px 0 20px 0;
}

.address-selection-info {
    background: #e3f2fd;
    border: 1px solid #bbdefb;
    padding: 15px;
    border-radius: 4px;
    margin-top: 20px;
}

.address-selection-info p {
    margin: 0 0 10px 0;
    color: #1976d2;
    font-weight: 600;
}

.address-selection-info ul {
    margin: 0;
    padding-left: 20px;
    color: #1976d2;
}

.address-selection-info li {
    margin-bottom: 5px;
}

.address-selection-error {
    color: #dc3545;
    margin-top: 10px;
    padding: 10px;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
}

.address-selection-success {
    color: #155724;
    margin-top: 10px;
    padding: 10px;
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
}

/* Duplicated Cart Items Display */
.duplicated-cart-items {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.duplicated-cart-items h3 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 18px;
}

.duplicated-cart-items p {
    margin: 0 0 20px 0;
    color: #666;
    font-size: 14px;
}

.address-cart-group {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    margin-bottom: 15px;
    overflow: hidden;
}

.address-cart-title {
    background: #0073aa;
    color: #fff;
    margin: 0;
    padding: 12px 15px;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.address-cart-items {
    padding: 15px;
}

.address-cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.address-cart-item:last-child {
    border-bottom: none;
}

.item-name {
    font-weight: 500;
    color: #333;
}

.item-quantity {
    color: #666;
    font-size: 12px;
    margin-left: 5px;
}

.item-total {
    font-weight: 600;
    color: #0073aa;
}

.address-selection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
}

.address-selection-card {
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
}

.address-selection-card:hover {
    border-color: #0073aa;
    box-shadow: 0 2px 8px rgba(0, 115, 170, 0.2);
}

.address-checkbox-label {
    display: block;
    margin: 0;
    cursor: pointer;
}

.address-checkbox-label input[type="checkbox"] {
    display: none;
}

.address-checkbox-label input[type="checkbox"]:checked + .address-card-content {
    background: #e3f2fd;
    border-color: #0073aa;
}

.address-checkbox-label input[type="checkbox"]:checked + .address-card-content .address-header h4 {
    color: #0073aa;
}

/* Smart Checkbox Styles */
.address-checkbox-wrapper {
    position: relative;
    display: inline-block;
    margin-right: 12px;
    flex-shrink: 0;
}

.address-checkbox {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: relative;
    display: inline-block;
    width: 20px;
    height: 20px;
    background-color: #fff;
    border: 2px solid #ddd;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.address-checkbox:checked ~ .checkmark {
    background-color: #0073aa;
    border-color: #0073aa;
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 6px;
    top: 2px;
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.address-checkbox:checked ~ .checkmark:after {
    display: block;
}

.address-checkbox-wrapper:hover .checkmark {
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
}

.address-checkbox:checked ~ .checkmark:hover {
    background-color: #005a87;
    border-color: #005a87;
}

.address-header {
    display: flex;
    align-items: flex-start;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f0f0f0;
}

.address-title-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.address-title-section h4 {
    margin: 0;
    color: #333;
    font-size: 16px;
    font-weight: 600;
    transition: color 0.3s ease;
}

.address-checkbox:checked ~ .address-card-content .address-title-section h4 {
    color: #0073aa;
}

.address-card-content {
    padding: 15px;
    transition: all 0.3s ease;
}

.address-card-content .address-header {
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f0f0f0;
}

.address-card-content .address-header h4 {
    margin: 0;
    color: #333;
    font-size: 16px;
    font-weight: 600;
    transition: color 0.3s ease;
}

.address-card-content .address-details {
    margin-bottom: 0;
}

.address-card-content .address-details p {
    margin: 0 0 5px 0;
    color: #555;
    font-size: 13px;
    line-height: 1.4;
}

/* Responsive Design */
@media (max-width: 768px) {
    .addresses-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .addresses-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .address-actions {
        flex-direction: column;
    }
    
    .address-actions .button {
        width: 100%;
        text-align: center;
    }
    
    .form-row-first,
    .form-row-last {
        width: 100%;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .button {
        width: 100%;
        text-align: center;
    }
    
    .address-selection-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .address-form {
        padding: 20px;
    }
    
    .address-card {
        padding: 15px;
    }
    
    .checkout-address-selection {
        padding: 15px;
    }
}

/* Loading States */
.address-card.loading {
    opacity: 0.6;
    pointer-events: none;
}

.address-card.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Notices */
.woocommerce-notices-wrapper {
    margin: 20px 0;
}

.woocommerce-message {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 10px;
}

.woocommerce-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 10px;
}

/* Checkout address selection styles */
.checkout-address-selection {
    margin: 20px 0;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: #f9f9f9;
}

.checkout-address-selection h3 {
    margin-top: 0;
    color: #333;
}

.address-requirement {
    color: #d63638;
    font-weight: bold;
    margin: 10px 0;
}

.address-selection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.address-selection-card {
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    background: white;
    transition: all 0.3s ease;
    cursor: pointer;
}

.address-selection-card:hover {
    border-color: #0073aa;
    box-shadow: 0 2px 8px rgba(0, 115, 170, 0.1);
}

.address-selection-card.first-address {
    border-color: #0073aa;
    background: #f0f8ff;
}

.address-selection-card.first-address .required-badge {
    background: #d63638;
    color: white;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: bold;
    margin-left: 10px;
}

.address-checkbox-label {
    display: block;
    cursor: pointer;
    margin: 0;
}

.address-checkbox-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 10px;
}

.address-checkbox {
    margin: 0;
    transform: scale(1.2);
}

.checkmark {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-radius: 3px;
    background: white;
    position: relative;
    flex-shrink: 0;
}

.address-checkbox:checked ~ .checkmark {
    background: #0073aa;
    border-color: #0073aa;
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 6px;
    top: 2px;
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.address-checkbox:checked ~ .checkmark:after {
    display: block;
}

.address-title-section h4 {
    margin: 0 0 5px 0;
    color: #333;
    font-size: 16px;
}

.default-badge {
    background: #00a32a;
    color: white;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: bold;
    margin-left: 10px;
}

.address-details {
    margin-top: 10px;
    color: #666;
    font-size: 14px;
}

.address-details p {
    margin: 5px 0;
}

.address-selection-info {
    margin-top: 20px;
    padding: 15px;
    background: #e7f3ff;
    border-left: 4px solid #0073aa;
    border-radius: 0 5px 5px 0;
}

.address-selection-info ul {
    margin: 10px 0;
    padding-left: 20px;
}

.address-selection-info li {
    margin: 5px 0;
    color: #333;
}
