/* ============================================
   MODAL STYLING (Cart Page)
   ============================================ */

.zvi-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.zvi-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.zvi-modal-content {
    position: relative;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 700px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: zviModalSlideIn 0.3s ease-out;
}

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

.zvi-modal-header {
    padding: 30px 30px 20px;
    text-align: center;
    border-bottom: 2px solid #f0f0f0;
}

.zvi-modal-header h2 {
    margin: 0 0 10px;
    font-size: 28px;
    color: #2c3e50;
    font-weight: 700;
}

.zvi-modal-header p {
    margin: 0;
    color: #7f8c8d;
    font-size: 16px;
}

.zvi-modal-body {
    padding: 30px;
}

.zvi-choice-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.zvi-choice-card {
    position: relative;
    display: block;
    background: #f8f9fa;
    border: 3px solid #e0e0e0;
    border-radius: 10px;
    padding: 25px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.zvi-choice-card:hover {
    border-color: #3498db;
    background: #f0f8ff;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(52, 152, 219, 0.15);
}

.zvi-choice-card.selected {
    border-color: #2ecc71;
    background: #e8f8f0;
    box-shadow: 0 8px 25px rgba(46, 204, 113, 0.2);
}

.zvi-choice-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.zvi-choice-content {
    text-align: center;
}

.zvi-choice-icon {
    display: block;
    font-size: 48px;
    margin-bottom: 15px;
}

.zvi-choice-content h3 {
    margin: 0 0 10px;
    font-size: 20px;
    color: #2c3e50;
    font-weight: 600;
}

.zvi-choice-content p {
    margin: 0 0 15px;
    font-size: 14px;
    color: #7f8c8d;
    line-height: 1.5;
}

.zvi-choice-badge {
    display: inline-block;
    padding: 6px 16px;
    background: #3498db;
    color: #fff;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.zvi-choice-card.selected .zvi-choice-badge {
    background: #2ecc71;
}

.zvi-modal-footer {
    padding: 20px 30px 30px;
    text-align: center;
}

.zvi-modal-confirm {
    padding: 15px 40px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    border-radius: 6px !important;
    min-width: 220px;
}

.zvi-modal-confirm:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

body.zvi-modal-open {
    overflow: hidden;
}

/* ============================================
   CHECKOUT INFO BAR
   ============================================ */

.zvi-checkout-info {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px 25px;
    margin-bottom: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.zvi-info-message {
    margin: 0;
    color: #fff;
    font-size: 16px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.zvi-info-message strong {
    font-weight: 700;
}

.zvi-change-choice {
    color: #fff !important;
    text-decoration: underline !important;
    font-weight: 600;
    padding: 5px 15px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    transition: all 0.3s ease;
}

.zvi-change-choice:hover {
    background: rgba(255, 255, 255, 0.3);
    text-decoration: none !important;
}

/* ============================================
   RECIPIENT FIELDS STYLING
   ============================================ */

.recipient-fields-wrapper {
    margin-top: 30px;
    padding: 25px;
    background: #fff9e6;
    border: 2px solid #ffd700;
    border-radius: 8px;
    overflow: hidden; /* Ensure floated elements are contained */
    clear: both;
}

/* Same as buyer checkbox styling */
.zvi-same-as-buyer-wrapper {
    margin-bottom: 20px !important;
    padding: 15px;
    background: #fff;
    border-radius: 6px;
    border: 1px solid #ffd700;
}

.zvi-same-as-buyer-wrapper label {
    font-weight: 600 !important;
    color: #2c3e50 !important;
    font-size: 15px !important;
    cursor: pointer !important;
}

.zvi-same-as-buyer-checkbox input[type="checkbox"] {
    margin-right: 10px !important;
}

/* Readonly recipient fields styling */
.recipient-fields-wrapper input.zvi-readonly {
    background-color: #f5f5f5 !important;
    color: #666 !important;
    cursor: not-allowed !important;
    border-color: #ddd !important;
}

.recipient-fields-wrapper::after {
    content: "";
    display: table;
    clear: both;
}

.recipient-fields-wrapper h3 {
    margin-top: 0;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #ffd700;
    color: #2c3e50;
    font-size: 18px;
}

.recipient-fields-wrapper .form-row {
    margin-bottom: 15px;
    clear: both;
    width: 100%;
}

.recipient-fields-wrapper .form-row label {
    font-weight: 600;
}

.recipient-fields-wrapper .form-row.validate-required label abbr {
    color: #ff0000;
    text-decoration: none;
    border: none;
}

.recipient-fields-wrapper .form-row input {
    width: 100%;
    box-sizing: border-box;
}

/* Ensure WooCommerce form-row classes work properly */
.recipient-fields-wrapper .form-row-wide {
    width: 100%;
    float: none;
}

.recipient-fields-wrapper .form-row-first,
.recipient-fields-wrapper .form-row-last {
    width: 48%;
    float: left;
}

.recipient-fields-wrapper .form-row-last {
    float: right;
}

/* Special layout for postcode + city */
.recipient-fields-wrapper #recipient_postcode_field {
    width: 30%;
    float: left;
    margin-right: 2%;
    clear: none !important; /* Override the clear: both */
}

.recipient-fields-wrapper #recipient_city_field {
    width: 68%;
    float: right;
    margin-left: 0;
    clear: none !important; /* Override the clear: both */
}

/* Clear after city field to prevent next fields from floating */
.recipient-fields-wrapper #recipient_city_field::after {
    content: "";
    display: table;
    clear: both;
}

/* ============================================
   PUBLIC FUNDING DECLARATION STYLING
   ============================================ */

.zvi-declaration-wrapper {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 2px solid #ffd700;
    clear: both;
}

.zvi-declaration-wrapper h4 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
}

.zvi-declaration-checkbox {
    margin-bottom: 15px !important;
    line-height: 1.6 !important;
    display: block !important;
}

.zvi-declaration-checkbox label {
    font-weight: 600 !important;
    line-height: 1.6 !important;
    display: inline !important;
    cursor: pointer !important;
    font-size: 14px !important;
    margin-left: 0 !important;
}

/* Multiple selectors to override any theme styles */
.recipient-fields-wrapper .zvi-declaration-checkbox input[type="checkbox"],
.zvi-declaration-checkbox input[type="checkbox"],
.zvi-declaration-checkbox .zvi-checkbox-input,
input#public_funding_declaration,
input.zvi-checkbox-input {
    display: inline-block !important;
    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;
    min-height: 20px !important;
    max-width: 20px !important;
    max-height: 20px !important;
    margin: 0 10px 0 0 !important;
    padding: 0 !important;
    vertical-align: middle !important;
    cursor: pointer !important;
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    opacity: 1 !important;
    visibility: visible !important;
    appearance: auto !important;
    -webkit-appearance: checkbox !important;
    -moz-appearance: checkbox !important;
    border: 1px solid #999 !important;
    background: #fff !important;
    float: none !important;
    clip: auto !important;
    clip-path: none !important;
    transform: none !important;
    z-index: 1 !important;
}

.zvi-declaration-note {
    margin-top: 15px !important;
    padding: 15px !important;
    background: #fff !important;
    border-left: 4px solid #ff9800 !important;
    font-size: 12px !important;
    line-height: 1.5 !important;
}

.zvi-declaration-note p {
    margin: 8px 0 !important;
    font-size: 12px !important;
}

.zvi-declaration-note strong {
    color: #2c3e50 !important;
    font-weight: 700 !important;
    font-size: 12px !important;
}

.zvi-declaration-warning {
    color: #d32f2f !important;
    font-weight: 600 !important;
    font-size: 12px !important;
}

.zvi-declaration-tax-info {
    color: #666 !important;
    font-style: italic !important;
    font-size: 12px !important;
}

.zvi-declaration-tax-info small {
    font-size: 12px !important;
}

/* ============================================
   ADMIN META BOX STYLING
   ============================================ */

.vat-exemption-details p {
    margin: 8px 0;
    line-height: 1.6;
}

.vat-exemption-details strong {
    display: block;
    margin-top: 10px;
    color: #2c3e50;
}

.vat-exemption-details hr {
    margin: 15px 0;
    border: none;
    border-top: 1px solid #ddd;
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */

@media (max-width: 768px) {
    .zvi-modal-content {
        width: 95%;
        max-height: 95vh;
    }

    .zvi-modal-header {
        padding: 20px 20px 15px;
    }

    .zvi-modal-header h2 {
        font-size: 22px;
    }

    .zvi-modal-header p {
        font-size: 14px;
    }

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

    .zvi-choice-wrapper {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .zvi-choice-card {
        padding: 20px 15px;
    }

    .zvi-choice-icon {
        font-size: 40px;
    }

    .zvi-choice-content h3 {
        font-size: 18px;
    }

    .zvi-choice-content p {
        font-size: 13px;
    }

    .zvi-modal-confirm {
        width: 100%;
        padding: 12px 20px !important;
        font-size: 15px !important;
    }

    .zvi-checkout-info {
        padding: 15px 20px;
    }

    .zvi-info-message {
        font-size: 14px;
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .zvi-change-choice {
        display: inline-block;
    }

    .recipient-fields-wrapper {
        padding: 20px 15px;
    }

    /* Stack postcode and city on mobile */
    .recipient-fields-wrapper #recipient_postcode_field,
    .recipient-fields-wrapper #recipient_city_field {
        width: 100%;
        float: none;
        margin-right: 0;
        margin-left: 0;
    }
}

@media (max-width: 480px) {
    .zvi-modal-header h2 {
        font-size: 20px;
    }

    .zvi-choice-icon {
        font-size: 36px;
        margin-bottom: 10px;
    }

    .zvi-choice-content h3 {
        font-size: 16px;
    }

    .zvi-choice-content p {
        font-size: 12px;
        margin-bottom: 12px;
    }

    .zvi-choice-badge {
        font-size: 12px;
        padding: 5px 12px;
    }
}

/* ============================================
   PRODUCT DURATION ON PRODUCT CARD
   ============================================ */

.woocommerce ul.products li.product .product-duration,
ul.products li.product .product-duration,
.product-duration {
    margin-top: 8px !important;
    margin-bottom: 0 !important;
    font-size: 13px !important;
    color: #666 !important;
    text-align: center !important;
    line-height: 1.4 !important;
    width: 100% !important;
    display: block !important;
    clear: both !important;
}

.woocommerce ul.products li.product .product-duration .duration-label,
.product-duration .duration-label {
    font-weight: 400 !important;
    color: #888 !important;
    margin-right: 5px !important;
}

.woocommerce ul.products li.product .product-duration .duration-text,
.product-duration .duration-text {
    font-weight: 600 !important;
    color: #333 !important;
}
