/**
 * WebMaxBooking – Vouchers CSS
 * FINAL – Stable Layout + Clean Design + Polished Modal
 */

/* =====================================================
   1. SECTION CONTAINER & GRID (FIXED)
   ===================================================== */

.webmaxbooking-vouchers {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 16px;
    box-sizing: border-box;
    font-family: inherit;
}

.webmaxbooking-vouchers__grid {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    align-items: stretch;
}

/* Tablet */
@media (max-width: 1024px) {
    .webmaxbooking-vouchers {
        max-width: 960px;
    }

    .webmaxbooking-vouchers__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Mobile */
@media (max-width: 640px) {
    .webmaxbooking-vouchers {
        max-width: 100%;
        padding: 16px 12px;
    }

    .webmaxbooking-vouchers__grid {
        grid-template-columns: 1fr;
    }
}

/* Prevent theme containers from shrinking the section */
.entry-content .webmaxbooking-vouchers,
.wp-block-group .webmaxbooking-vouchers {
    width: 100% !important;
    max-width: 1200px !important;
}

/* =====================================================
   2. VOUCHER CARD (RESTORED & CLEAN)
   ===================================================== */

.webmaxvoucher-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: var(--webmax-card-radius, 12px);
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05),
        0 2px 4px -1px rgba(0, 0, 0, 0.03);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.webmaxvoucher-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08),
        0 4px 6px -2px rgba(0, 0, 0, 0.04);
}

/* Image Area */
.webmaxvoucher-card__media {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    background: #f1f5f9;
    overflow: hidden;
}

.webmaxvoucher-card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.webmaxvoucher-card__img-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #cbd5e1;
    font-size: 48px;
}

/* Price Badge */
.webmaxvoucher-card__price {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.95);
    padding: 6px 14px;
    border-radius: 9999px;
    font-size: 14px;
    font-weight: 700;
    color: var(--webmax-primary, #20C7CA);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Card Body */
.webmaxvoucher-card__body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.webmaxvoucher-card__title {
    margin: 0 0 6px;
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
}

.webmaxvoucher-card__meta {
    font-size: 14px;
    color: #64748b;
    line-height: 1.5;
    margin-bottom: 20px;
}

/* CTA */
.webmaxvoucher-card__cta.webmaxbooking-btn {
    margin-top: auto;
    width: 100%;
    justify-content: center;
    padding: 12px 20px;
    font-size: 15px;
    font-weight: 600;
    color: #ffffff;
    background: var(--webmax-primary, #20C7CA);
    border-radius: var(--webmax-btn-radius, 8px);
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.webmaxvoucher-card__cta:hover {
    background: var(--webmax-primary-hover, #1AB0B3);
}

/* =====================================================
   3. MODAL (POLISHED – DESKTOP & MOBILE)
   ===================================================== */

.webmaxbooking-voucher-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.webmaxbooking-voucher-modal.is-open {
    opacity: 1;
    visibility: visible;
}

.webmaxbooking-voucher-modal__dialog {
    background: #ffffff;
    width: 100%;
    max-width: 520px;
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1),
        0 10px 10px -5px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: webmaxSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes webmaxSlideUp {
    from {
        transform: translateY(20px) scale(0.95);
        opacity: 0;
    }

    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.webmaxbooking-voucher-modal__close {
    position: absolute;
    top: 14px;
    right: 14px;
    background: transparent;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
}

.webmaxbooking-voucher-modal__close:hover {
    background: #f1f5f9;
    color: #334155;
}

.webmaxbooking-voucher-modal__content {
    padding: 30px;
    overflow-y: auto;
}

.webmaxbooking-voucher-modal__title {
    margin: 0 0 6px;
    font-size: 24px;
    font-weight: 700;
    color: #0f172a;
}

.webmaxbooking-voucher-modal__price {
    margin-bottom: 20px;
    font-size: 18px;
    font-weight: 600;
    color: var(--webmax-primary, #20C7CA);
}

/* =====================================================
   4. FORM STYLES (USED BY PAYMENT STEP LATER)
   ===================================================== */

.webmaxbooking-form-group {
    margin-bottom: 20px;
}

.webmaxbooking-form-group label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #334155;
    margin-bottom: 6px;
}

.webmaxbooking-input {
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    color: #0f172a;
    box-sizing: border-box;
}

.webmaxbooking-input:focus {
    outline: none;
    border-color: var(--webmax-primary, #20C7CA);
    box-shadow: 0 0 0 3px rgba(32, 199, 202, 0.12);
}

/* Mobile modal behaviour */
@media (max-width: 640px) {
    .webmaxbooking-voucher-modal {
        padding: 0;
        align-items: flex-end;
    }

    .webmaxbooking-voucher-modal__dialog {
        border-radius: 20px 20px 0 0;
        max-height: 90vh;
    }
}

/* =====================================================
   FIX: PAY NOW BUTTON (Voucher Modal)
   ===================================================== */

.webmaxbooking-voucher-modal .webmaxvoucher-pay-now.webmaxbooking-btn {
    width: 100% !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;

    padding: 14px 20px !important;
    margin-top: 10px;

    font-size: 16px !important;
    font-weight: 700 !important;
    letter-spacing: 0.3px;

    color: #ffffff !important;
    background-color: var(--webmax-primary, #20C7CA) !important;
    border: none !important;
    border-radius: 10px !important;

    cursor: pointer;
    transition: background-color 0.2s ease,
        transform 0.1s ease,
        box-shadow 0.2s ease;

    box-shadow: 0 6px 12px rgba(32, 199, 202, 0.35);
}

/* Hover */
.webmaxbooking-voucher-modal .webmaxvoucher-pay-now.webmaxbooking-btn:hover {
    background-color: var(--webmax-primary-hover, #1AB0B3) !important;
    transform: translateY(-1px);
}

/* Active */
.webmaxbooking-voucher-modal .webmaxvoucher-pay-now.webmaxbooking-btn:active {
    transform: translateY(0);
    box-shadow: 0 4px 8px rgba(32, 199, 202, 0.3);
}

/* Disabled (future-proof for payment processing) */
.webmaxbooking-voucher-modal .webmaxvoucher-pay-now.webmaxbooking-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    box-shadow: none;
}