/* ==========================================================================
   Sabai Thai Spa Vouchers Section Styles
   ========================================================================== */
.cm-sabaithai-vouchers-section {
    background-color: #ffffff;
    padding: 85px 0 95px;
    box-sizing: border-box;
}

.cm-sabaithai-vouchers-section *,
.cm-sabaithai-vouchers-section *::before,
.cm-sabaithai-vouchers-section *::after {
    box-sizing: border-box;
}

.cm-sabaithai-vouchers-container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.cm-vouchers-header {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 42px;
}

.cm-vouchers-header .cm-vouchers-title {
    font-size: 2.6rem;
    font-weight: 500;
    color: #4a4a4a;
    margin: 0 0 12px;
    letter-spacing: -0.3px;
    line-height: 1.25;
}

.cm-vouchers-header .cm-vouchers-title sup {
    font-size: 0.5em;
    font-weight: 400;
    top: -0.5em;
    position: relative;
}

.cm-vouchers-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin: 12px auto 14px;
}

.cm-vouchers-divider .cm-divider-line {
    display: inline-block;
    width: 75px;
    height: 1.5px;
    background-color: #c59b27;
}

.cm-vouchers-divider .cm-vouchers-emblem {
    height: 38px;
    width: auto;
    display: block;
    object-fit: contain;
}

.cm-vouchers-subtitle {
    font-size: 1rem;
    color: #555555;
    margin: 0;
    line-height: 1.5;
}

/* Grid */
.cm-vouchers-grid {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: var(--cm-gap, 28px) !important;
    align-items: stretch;
    justify-content: var(--cm-align, center) !important;
    --cm-cols: 3;
    --cm-gap: 28px;
    --cm-align: center;
    width: 100%;
    box-sizing: border-box;
}

.cm-vouchers-grid.cm-align-center,
.cm-vouchers-grid.cm-align-middle {
    justify-content: center !important;
}

.cm-vouchers-grid.cm-align-right,
.cm-vouchers-grid.cm-align-end {
    justify-content: flex-end !important;
}

.cm-vouchers-grid.cm-align-left,
.cm-vouchers-grid.cm-align-start {
    justify-content: flex-start !important;
}

.cm-vouchers-grid.cm-cols-1 {
    --cm-cols: 1;
}
.cm-vouchers-grid.cm-cols-1 .cm-voucher-card {
    max-width: 580px !important;
}

.cm-vouchers-grid.cm-cols-2 {
    --cm-cols: 2;
}

.cm-vouchers-grid.cm-cols-3 {
    --cm-cols: 3;
}

.cm-vouchers-grid.cm-cols-4 {
    --cm-cols: 4;
    --cm-gap: 20px;
    gap: 20px !important;
}

.cm-vouchers-grid.cm-cols-5 {
    --cm-cols: 5;
    --cm-gap: 16px;
    gap: 16px !important;
}

.cm-sabaithai-vouchers-container:has(.cm-cols-4),
.cm-sabaithai-vouchers-container:has(.cm-cols-5) {
    max-width: 1400px;
}

/* Card */
.cm-voucher-card,
.cm-vouchers-grid .cm-voucher-card {
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid #e8e8e8;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
    transition: transform 0.3s cubic-bezier(0.165, 0.84, 0.44, 1), box-shadow 0.3s ease;
    position: relative;
    min-width: 0;
    box-sizing: border-box;
    flex: 0 0 calc((100% - (var(--cm-cols, 3) - 1) * var(--cm-gap, 28px)) / var(--cm-cols, 3)) !important;
    width: calc((100% - (var(--cm-cols, 3) - 1) * var(--cm-gap, 28px)) / var(--cm-cols, 3)) !important;
    max-width: calc((100% - (var(--cm-cols, 3) - 1) * var(--cm-gap, 28px)) / var(--cm-cols, 3)) !important;
}

/* Compact layout for 4 or 5 columns */
.cm-vouchers-grid.cm-cols-4 .cm-voucher-card-media,
.cm-vouchers-grid.cm-cols-5 .cm-voucher-card-media {
    height: 195px;
    padding: 14px 10px;
}

.cm-vouchers-grid.cm-cols-4 .cm-media-title-main,
.cm-vouchers-grid.cm-cols-5 .cm-media-title-main {
    font-size: 1.25rem;
}

.cm-vouchers-grid.cm-cols-4 .cm-media-title-sub,
.cm-vouchers-grid.cm-cols-5 .cm-media-title-sub {
    font-size: 0.92rem;
}

.cm-vouchers-grid.cm-cols-4 .cm-voucher-card-body,
.cm-vouchers-grid.cm-cols-5 .cm-voucher-card-body {
    padding: 16px 14px 12px;
}

.cm-vouchers-grid.cm-cols-4 .cm-voucher-title,
.cm-vouchers-grid.cm-cols-5 .cm-voucher-title {
    font-size: 1rem;
    margin-bottom: 6px;
}

.cm-vouchers-grid.cm-cols-4 .cm-voucher-location,
.cm-vouchers-grid.cm-cols-5 .cm-voucher-location {
    font-size: 0.78rem;
    margin-bottom: 6px;
}

.cm-vouchers-grid.cm-cols-4 .cm-voucher-category,
.cm-vouchers-grid.cm-cols-5 .cm-voucher-category {
    font-size: 0.8rem;
    margin-bottom: 6px;
}

.cm-vouchers-grid.cm-cols-4 .cm-voucher-desc,
.cm-vouchers-grid.cm-cols-5 .cm-voucher-desc {
    font-size: 14px;
    margin-bottom: 14px;
    line-height: 1.4;
}

.cm-vouchers-grid.cm-cols-4 .cm-voucher-price-current,
.cm-vouchers-grid.cm-cols-5 .cm-voucher-price-current {
    font-size: 1.15rem;
}

.cm-vouchers-grid.cm-cols-4 .cm-voucher-btn-cart,
.cm-vouchers-grid.cm-cols-5 .cm-voucher-btn-cart,
.cm-sabaithai-vouchers-section .cm-vouchers-grid.cm-cols-4 .cm-voucher-btn-cart,
.cm-sabaithai-vouchers-section .cm-vouchers-grid.cm-cols-5 .cm-voucher-btn-cart {
    font-size: 14px;
    padding: 6px 10px;
}

.cm-vouchers-grid.cm-cols-4 .cm-voucher-countdown,
.cm-vouchers-grid.cm-cols-5 .cm-voucher-countdown {
    padding: 4px 8px;
    margin-top: 6px;
}

.cm-vouchers-grid.cm-cols-4 .cm-countdown-unit,
.cm-vouchers-grid.cm-cols-5 .cm-countdown-unit {
    min-width: 28px;
}

.cm-vouchers-grid.cm-cols-4 .cm-countdown-num,
.cm-vouchers-grid.cm-cols-5 .cm-countdown-num {
    font-size: 0.88rem;
}

.cm-vouchers-grid.cm-cols-4 .cm-countdown-lbl,
.cm-vouchers-grid.cm-cols-5 .cm-countdown-lbl {
    font-size: 0.5rem;
}

.cm-vouchers-grid.cm-cols-4 .cm-countdown-divider,
.cm-vouchers-grid.cm-cols-5 .cm-countdown-divider {
    height: 18px;
    margin: 0 4px;
}

.cm-voucher-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}

/* Card Media */
.cm-voucher-card-media {
    position: relative;
    height: 250px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    text-align: center;
    padding: 20px 16px;
    color: #ffffff;
    overflow: hidden;
}

.cm-voucher-card-media::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.88) 0%, rgba(0, 0, 0, 0.45) 50%, rgba(0, 0, 0, 0.1) 85%, rgba(0, 0, 0, 0.25) 100%);
    z-index: 1;
    pointer-events: none;
}

.cm-voucher-card-media.no-text-overlay::before {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.45) 0%, rgba(0, 0, 0, 0.05) 50%, rgba(0, 0, 0, 0) 100%);
}

/* Wishlist Button */
.cm-voucher-wishlist-btn {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 4;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #ffffff;
    border: none;
    outline: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    color: #222222;
    font-size: 0.95rem;
    padding: 0;
    text-decoration: none;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), color 0.2s ease, background-color 0.2s ease;
}

.cm-voucher-wishlist-btn:hover {
    transform: scale(1.12);
    color: #e83e8c;
}

.cm-voucher-wishlist-btn:active {
    transform: scale(0.92);
}

.cm-voucher-wishlist-btn.active,
.cm-voucher-wishlist-btn.active i,
.cm-voucher-wishlist-btn.active svg {
    color: #e83e8c !important;
}

.cm-voucher-wishlist-btn.active i {
    animation: cmHeartPop 0.35s ease;
}

@keyframes cmHeartPop {
    0% { transform: scale(1); }
    50% { transform: scale(1.35); }
    100% { transform: scale(1); }
}

/* Media Overlay Content */
.cm-voucher-media-content {
    position: relative;
    z-index: 2;
    width: 100%;
}

.cm-voucher-media-title .cm-media-title-sub {
    display: block;
    font-style: italic;
    font-size: 1.15rem;
    font-weight: 500;
    color: #ffffff;
    line-height: 1.3;
}

.cm-voucher-media-title .cm-media-title-main {
    display: block;
    font-style: italic;
    font-size: 1.55rem;
    font-weight: 500;
    color: #ffffff;
    line-height: 1.25;
    margin-bottom: 6px;
}

.cm-voucher-media-tag {
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    color: #e0e0e0;
    margin-top: 4px;
}

/* Countdown Timer */
.cm-voucher-countdown {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.78);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-radius: 4px;
    padding: 6px 14px;
    margin-top: 10px;
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.cm-countdown-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 38px;
}

.cm-countdown-num {
    display: block;
    font-size: 1.05rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.1;
}

.cm-countdown-lbl {
    display: block;
    font-size: 0.55rem;
    font-weight: 600;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: #d4d4d4;
    margin-top: 2px;
}

.cm-countdown-divider {
    width: 1px;
    height: 22px;
    background: rgba(255, 255, 255, 0.25);
    margin: 0 8px;
}

/* Card Body */
.cm-voucher-card-body {
    padding: 22px 20px 18px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.cm-voucher-title {
    font-size: 1.12rem;
    font-weight: 600;
    color: #5F664D;
    margin: 0 0 10px;
    line-height: 1.35;
}

.cm-voucher-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.cm-voucher-title a:hover {
    color: #5F664D;
}

.cm-voucher-location {
    font-size: 0.85rem;
    color: #6C757D;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    line-height: 1.4;
}

.cm-voucher-location i,
.cm-voucher-location svg {
    color: #555555;
    font-size: 0.92rem;
    flex-shrink: 0;
}

.cm-voucher-category {
    font-size: 0.88rem;
    font-weight: 600;
    color: #848484;
    margin-bottom: 10px;
    line-height: 1.3;
}

.cm-voucher-desc {
    font-size: 16px;
    color: #6C757D;
    line-height: 1.5;
    margin: 0 0 22px;
    flex-grow: 1;
}

/* Price Row */
.cm-voucher-price-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: auto;
    padding-bottom: 10px;
}

.cm-voucher-prices {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.cm-voucher-price-original {
    font-size: 0.95rem;
    color: #8C8C8C;
    text-decoration: line-through;
    line-height: 1.2;
}

.cm-voucher-price-current {
    font-size: 1.35rem;
    font-weight: 500;
    color: #5F664D;
    line-height: 1.2;
}

/* Cart Button */
.cm-voucher-btn-cart,
.cm-sabaithai-vouchers-section .cm-voucher-btn-cart {
    background: #ffffff;
    color: #5F664D;
    border: 1px solid #707070;
    border-radius: 4px;
    padding: 7px 18px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.cm-voucher-btn-cart:hover,
.cm-sabaithai-vouchers-section .cm-voucher-btn-cart:hover,
a.cm-voucher-btn-cart:hover {
    background: #5F664D !important;
    background-color: #5F664D !important;
    color: #ffffff !important;
    border-color: #5F664D !important;
}

/* Tree Note */
.cm-voucher-tree-note {
    font-size: 0.76rem;
    font-style: italic;
    color: #777777;
    margin-top: 4px;
    line-height: 1.4;
    border-top: 1px solid #f2f2f2;
    padding-top: 8px;
}

/* Empty State / Notice */
.cm-vouchers-empty-msg {
    grid-column: 1 / -1;
    width: 100%;
    flex: 0 0 100%;
    text-align: center;
    padding: 40px 20px;
    color: #777777;
    font-style: italic;
    font-size: 0.95rem;
}

/* Responsive Media Queries */
@media (max-width: 1024px) {
    .cm-vouchers-grid {
        --cm-cols: 2;
        --cm-gap: 20px;
        gap: 20px;
    }
    .cm-vouchers-grid.cm-cols-3 .cm-voucher-card,
    .cm-vouchers-grid.cm-cols-4 .cm-voucher-card,
    .cm-vouchers-grid.cm-cols-5 .cm-voucher-card {
        flex: 0 0 calc((100% - 20px) / 2);
        width: calc((100% - 20px) / 2);
        max-width: calc((100% - 20px) / 2);
    }
}

@media (max-width: 992px) {
    .cm-vouchers-grid {
        gap: 22px;
    }

    .cm-vouchers-header .cm-vouchers-title {
        font-size: 2.1rem;
    }
}

@media (max-width: 680px) {
    .cm-vouchers-grid {
        --cm-cols: 1;
        gap: 24px;
    }

    .cm-vouchers-grid .cm-voucher-card,
    .cm-vouchers-grid.cm-cols-1 .cm-voucher-card,
    .cm-vouchers-grid.cm-cols-2 .cm-voucher-card,
    .cm-vouchers-grid.cm-cols-3 .cm-voucher-card,
    .cm-vouchers-grid.cm-cols-4 .cm-voucher-card,
    .cm-vouchers-grid.cm-cols-5 .cm-voucher-card {
        flex: 0 0 100%;
        width: 100%;
        max-width: 100%;
    }

    .cm-sabaithai-vouchers-section {
        padding: 55px 0 65px;
    }

    .cm-vouchers-header {
        margin-bottom: 32px;
    }

    .cm-vouchers-header .cm-vouchers-title {
        font-size: 1.85rem;
    }

    .cm-voucher-card-media {
        height: 220px;
    }
}
