/* Woocommerce Custom Addresses Styles */
.wca-addresses-page {
    direction: rtl;
    text-align: right;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.wca-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.wca-header h2 {
    color: #333;
    margin: 0;
    font-size: 24px;
    font-weight: 600;
}

.wca-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    min-width: 120px;
}

.wca-btn-primary {
    background: #007cba;
    color: white;
}

.wca-btn-primary:hover {
    background: #005a87;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 124, 186, 0.3);
}

.wca-btn-edit {
    background: #f0ad4e;
    color: white;
    padding: 8px 16px;
    font-size: 13px;
    min-width: 80px;
}

.wca-btn-edit:hover {
    background: #ec971f;
    transform: translateY(-1px);
}

.wca-btn-delete {
    background: #d9534f;
    color: white;
    padding: 8px 16px;
    font-size: 13px;
    min-width: 80px;
}

.wca-btn-delete:hover {
    background: #c9302c;
    transform: translateY(-1px);
}

.wca-btn-cancel {
    background: #6c757d;
    color: white;
}

.wca-btn-cancel:hover {
    background: #545b62;
    transform: translateY(-1px);
}

/* Address Cards */
.wca-addresses-list {
    margin-top: 20px;
}

.wca-address-card {
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 20px;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    position: relative;
}

.wca-address-card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.wca-address-content h4 {
    margin: 0 0 12px 0;
    color: #2c3e50;
    font-size: 18px;
    font-weight: 600;
}

.wca-address-content p {
    margin: 6px 0;
    color: #555;
    line-height: 1.6;
    font-size: 14px;
}

.wca-address-actions {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.wca-no-addresses {
    text-align: center;
    padding: 60px 40px;
    color: #666;
    background: #f9f9f9;
    border-radius: 10px;
    border: 2px dashed #ddd;
    font-size: 16px;
}

/* Modal Styles */
.wca-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    backdrop-filter: blur(4px);
    animation: wcaFadeIn 0.3s ease;
}

@keyframes wcaFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.wca-modal-content {
    background: white;
    margin: 2% auto;
    width: 90%;
    max-width: 600px;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: wcaModalSlideIn 0.3s ease;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

@keyframes wcaModalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.wca-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    border-bottom: 1px solid #eee;
    background: #f8f9fa;
}

.wca-modal-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 20px;
    font-weight: 600;
}

.wca-close {
    font-size: 28px;
    cursor: pointer;
    color: #999;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    line-height: 1;
}

.wca-close:hover {
    background: #e9ecef;
    color: #333;
    transform: rotate(90deg);
}

.wca-modal-body {
    padding: 30px;
    overflow-y: auto;
    flex: 1;
}

/* Form Styles */
.wca-address-form {
    direction: rtl;
}

.wca-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.wca-form-group {
    margin-bottom: 20px;
}

.wca-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
}

.wca-form-group input,
.wca-form-group select,
.wca-form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    box-sizing: border-box;
    font-family: inherit;
}

.wca-form-group input:focus,
.wca-form-group select:focus,
.wca-form-group textarea:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
    background-color: #fff;
}

.wca-form-group textarea {
    min-height: 100px;
    resize: vertical;
    line-height: 1.5;
}

.wca-form-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    padding-top: 25px;
    border-top: 1px solid #eee;
}

.wca-form-actions .wca-btn {
    flex: 1;
    padding: 14px;
    font-size: 15px;
    font-weight: 600;
}

.wca-help-text {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #6c757d;
    font-style: italic;
}

/* Checkout Addresses */
.wca-checkout-addresses {
    margin: 25px 0;
    padding: 25px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 2px solid #e9ecef;
}

.wca-checkout-addresses h3 {
    margin: 0 0 20px 0;
    color: #2c3e50;
    font-size: 18px;
    font-weight: 600;
}

.wca-addresses-select {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.wca-address-option {
    display: flex;
    align-items: flex-start;
    padding: 20px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.wca-address-option:hover {
    border-color: #007cba;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.wca-address-option input[type="radio"] {
    margin: 3px 12px 0 0;
    transform: scale(1.2);
}

.wca-address-option label {
    cursor: pointer;
    margin: 0;
    flex: 1;
    color: #555;
    line-height: 1.6;
}

.wca-address-option input[type="radio"]:checked+label {
    color: #007cba;
    font-weight: 500;
}

/* Style for selected address option */
.wca-address-option:has(input[type="radio"]:checked) {
    border-color: #007cba;
    background: linear-gradient(135deg, #f0f8ff 0%, #e6f3ff 100%);
    box-shadow: 0 4px 15px rgba(0, 124, 186, 0.2);
}

.wca-address-option:has(input[type="radio"]:checked)::before {
    content: '✓';
    position: absolute;
    top: 10px;
    left: 10px;
    background: #007cba;
    color: white;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

.wca-address-option input[type="radio"]:checked~.wca-address-option {
    border-color: #007cba;
    background: #f8f9fa;
}

.wca-address-option input[type="radio"]:checked {
    accent-color: #007cba;
}

/* Messages */
.wca-message {
    padding: 15px 20px;
    border-radius: 8px;
    margin: 0 0 25px 0;
    text-align: center;
    font-weight: 500;
    border: 1px solid transparent;
}

.wca-message.success {
    background: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}

.wca-message.error {
    background: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}

.wca-message.info {
    background: #cce7ff;
    color: #004085;
    border-color: #b3d7ff;
}

/* Loading */
.wca-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007cba;
    border-radius: 50%;
    animation: wcaSpin 1s linear infinite;
    margin-left: 10px;
    vertical-align: middle;
}

@keyframes wcaSpin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .wca-addresses-page {
        padding: 15px;
    }

    .wca-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .wca-form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .wca-form-actions {
        flex-direction: column;
    }

    .wca-modal-content {
        margin: 5% auto;
        width: 95%;
        height: 95vh;
    }

    .wca-modal-body {
        padding: 20px;
    }

    .wca-address-actions {
        flex-direction: column;
    }

    .wca-address-option {
        padding: 15px;
    }

    .wca-checkout-addresses {
        padding: 20px;
        margin: 20px 0;
    }
}

@media (max-width: 480px) {
    .wca-address-card {
        padding: 20px;
    }

    .wca-btn {
        padding: 10px 16px;
        font-size: 13px;
        min-width: 100px;
    }

    .wca-modal-header {
        padding: 20px;
    }

    .wca-modal-header h3 {
        font-size: 18px;
    }
}