/**
 * Class Variations Module Stylesheet
 * 
 * Location: divi-module-class-variations/css/cvm-styles.css
 */

/* ==========================================================================
   1. Standard Detailed Variations List
   ========================================================================== */

.cvm-variation-list {
    display: grid;
    gap: 20px;
}

.cvm-variation-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 20px;
}

.cvm-variation-card.cvm-unavailable {
    opacity: .55;
}

.cvm-variation-attributes {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 24px;
    margin: 0 0 12px;
}

.cvm-attribute {
    display: flex;
    flex-direction: column;
}

.cvm-attribute dt {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.cvm-attribute dd {
    margin: 3px 0 0;
}

.cvm-price {
    margin-top: 8px;
    font-weight: 700;
}

.cvm-stock {
    margin-top: 6px;
    font-size: 14px;
}

.cvm-variation-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: 14px;
    width: 100%;
    background: rgb(255 255 255 / 75%) !important;
    border-radius: 0.5rem;
    padding: 0.5rem;
}

.cvm-variation-footer .cvm-price {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
    line-height: 1.2;
}

.cvm-variation-footer .cvm-variation-action {
    flex: 1;
    margin: 0;
    width: auto;
}

.cvm-variation-footer .cvm-register-button {
    display: block;
    width: 100%;
    text-align: center;
    box-sizing: border-box;
}

.cvm-register-button {
    display: inline-block;
    padding: 10px 18px;
    border-radius: 4px;
    background: #222;
    color: #fff;
    text-decoration: none;
    white-space: nowrap;
}

.cvm-register-button:hover {
    background: #555;
    color: #fff;
}

.cvm-variation-card.cvm-layout-column {
    flex-direction: column;
    align-items: stretch;
    gap: 15px;
}

.cvm-variation-card.cvm-layout-column .cvm-variation-action {
    margin-top: 0;
    width: auto;
}

.cvm-variation-card.cvm-layout-column .cvm-register-button {
    display: block;
    text-align: center;
}

@media (max-width: 767px) {
    .cvm-variation-card {
        display: block;
    }

    .cvm-variation-action {
        margin-top: 16px;
    }
}

/* ==========================================================================
   2. Scheduled Classes Grid
   ========================================================================== */

.cvm-scheduled-classes-grid {
    display: grid;
    gap: 20px;
}

.cvm-scheduled-classes-grid.cvm-grid-cols-1 {
    grid-template-columns: 1fr;
}

.cvm-scheduled-classes-grid.cvm-grid-cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

.cvm-scheduled-classes-grid.cvm-grid-cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

.cvm-scheduled-classes-grid.cvm-grid-cols-4 {
    grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 767px) {

    .cvm-scheduled-classes-grid.cvm-grid-cols-2,
    .cvm-scheduled-classes-grid.cvm-grid-cols-3,
    .cvm-scheduled-classes-grid.cvm-grid-cols-4 {
        grid-template-columns: 1fr;
    }
}

.cvm-class-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cvm-class-card .cvm-class-header {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 6px;
}

.cvm-class-card .cvm-class-location {
    font-weight: 700;
    font-size: 16px;
}

.cvm-class-card .cvm-class-title {
    font-size: 15px;
}

.cvm-class-card .cvm-class-date {
    font-size: 15px;
}

.cvm-class-card .cvm-class-time {
    font-size: 14px;
}

.cvm-variation-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
}

.cvm-variation-date,
.cvm-variation-end-date {
    font-size: 14px;
    color: #333;
    margin-bottom: 3px;
}

.cvm-variation-time,
.cvm-variation-duration {
    font-size: 13px;
    color: #333;
    margin-bottom: 6px;
}

.cvm-no-variations {
    padding: 15px;
    text-align: center;
    color: #777;
    font-style: italic;
}

/* ==========================================================================
   3. Compact Schedule Grid (Location Cards matching sketch)
   ========================================================================== */

.cvm-compact-grid {
    display: grid;
    gap: 1rem;
    width: 100%;
    box-sizing: border-box;
}

/* 2 Columns when Expos/Events Toggle is ON */
.cvm-compact-grid,
.cvm-compact-grid.cvm-grid-2cols {
    grid-template-columns: repeat(2, 1fr);
}

/* 3 Columns when Expos/Events Toggle is OFF (Desktop & Tablet) */
.cvm-compact-grid.cvm-grid-3cols {
    grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 980px) and (min-width: 681px) {
    .cvm-compact-grid.cvm-grid-3cols {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Mobile: Single Column Stack */
@media (max-width: 680px) {

    .cvm-compact-grid,
    .cvm-compact-grid.cvm-grid-2cols,
    .cvm-compact-grid.cvm-grid-3cols {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* Individual Location Card Container */
.cvm-compact-card {
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Location Header & Dividers */
.cvm-compact-header-wrap {
    margin: 0 0 0.5rem 0;
    padding: 0;
}

.cvm-compact-header {
    margin: 0;
    font-family: 'Inter', Helvetica, Arial, Lucida, sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.2;
    color: white;
    background-color: rgb(53 98 118);
    border-radius: 1000rem;
    padding: 0.25rem 0.75rem;
}

.cvm-compact-divider {
    height: 1px;
    background: currentColor;
    opacity: 0.25;
    margin: 0 0 16px 0;
    width: 100%;
    display: none;
}

.cvm-compact-internal-divider {
    height: 1px;
    background: currentColor;
    opacity: 0.18;
    margin: 14px 0;
    width: 100%;
    display: none;
}

.cvm-compact-body {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    justify-content: flex-start;
    gap: 1.2rem;
}

.cvm-compact-item {
    display: block;
    text-decoration: none;
    color: inherit;
    background: hsl(from rgb(255 255 255 / 25%) calc(h + 0) calc(s + 0) calc(l + 0) / 0.5);
    border: solid 2px #cda879;
    border-radius: 1rem;
}

/* Clickable Class Row with PDP / External Link */
a.cvm-compact-link {
    display: block;
    text-decoration: none;
    color: inherit;
    padding: 0.5rem 0.75rem;
    /* margin: -6px -8px; */
    border-radius: 6px;
    transition: background-color 0.15s ease, opacity 0.15s ease;
}

a.cvm-compact-link:hover,
a.cvm-compact-link:focus {
    opacity: 0.85;
    background-color: rgba(0, 0, 0, 0.04);
    text-decoration: none;
}

.cvm-compact-title {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 4px;
    color: inherit;
}

.cvm-compact-schedule {
    font-size: 16px;
    font-weight: 500;
    line-height: 1.35;
    opacity: 0.9;
    color: inherit;
}


/* ==========================================================================
   PDP Interactive Location & Schedule Card Selector
   ========================================================================== */

/* Expand WooCommerce variation table row for full-width card layout */
.single-product table.variations,
.single-product table.variations tbody,
.single-product table.variations tr,
.single-product table.variations td.value {
    display: block;
    width: 100%;
    box-sizing: border-box;
}

.single-product table.variations th.label {
    display: block;
    margin-bottom: 8px;
    font-size: 1.15rem;
    font-weight: 700;
}

.single-product .reset_variations {
    display: inline-block;
    margin-top: 10px;
    font-size: 0.85rem;
    color: #666;
    text-decoration: underline;
    transition: color 0.15s ease;
}

.single-product .reset_variations:hover {
    color: #000;
}

/* Cards Grid Container */
.cvm-pdp-cards-container {
    display: grid;
    gap: 16px;
    margin: 0;
    width: 100%;
    box-sizing: border-box;
}

.cvm-pdp-cards-container.cvm-pdp-cols-1 {
    grid-template-columns: 1fr;
}

.cvm-pdp-cards-container.cvm-pdp-cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

.cvm-pdp-cards-container.cvm-pdp-cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 768px) {

    .cvm-pdp-cards-container.cvm-pdp-cols-2,
    .cvm-pdp-cards-container.cvm-pdp-cols-3 {
        grid-template-columns: 1fr;
        gap: 14px;
    }
}

/* Individual Location Card */
.cvm-pdp-card {
    background-color: #f7e8dc;
    border: 2px solid #e8d7ca;
    border-radius: 12px;
    padding: 18px 20px;
    cursor: pointer;
    position: relative;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease, background-color 0.2s ease;
}

.cvm-pdp-card:hover {
    border-color: #222;
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.07);
}

.cvm-pdp-card:focus-visible {
    outline: 2px solid #222;
    outline-offset: 2px;
}

/* Selected Active State */
.cvm-pdp-card.is-selected {
    border-color: #222;
    background-color: #fcf4ed;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
}

/* Disabled / Out of Stock */
.cvm-pdp-card.is-disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

/* Card Header */
.cvm-pdp-card-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
}

.cvm-pdp-city {
    font-size: 1.45rem;
    font-weight: 700;
    line-height: 1.2;
    color: #111;
}

.cvm-pdp-check-badge {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid #c4b5a8;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: #fff;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

.cvm-pdp-check-badge svg {
    display: none;
    stroke: #fff;
}

.cvm-pdp-card.is-selected .cvm-pdp-check-badge {
    background: #222;
    border-color: #222;
}

.cvm-pdp-card.is-selected .cvm-pdp-check-badge svg {
    display: block;
}

.cvm-pdp-venue {
    font-size: 0.95rem;
    font-weight: 600;
    color: #222;
    margin: 2px 0 0 0;
    line-height: 1.35;
}

.cvm-pdp-address {
    font-size: 0.85rem;
    color: #666;
    margin: 2px 0 0 0;
    line-height: 1.3;
}

/* Divider */
.cvm-pdp-card-divider {
    height: 1px;
    background: currentColor;
    opacity: 0.15;
    margin: 12px 0;
    width: 100%;
}

/* Card Body & Rows */
.cvm-pdp-card-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.9rem;
    line-height: 1.4;
}

.cvm-pdp-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
}

.cvm-pdp-label {
    font-weight: 600;
    color: #555;
    flex-shrink: 0;
    font-size: 0.85rem;
}

.cvm-pdp-val {
    font-weight: 500;
    color: #111;
    text-align: right;
}

/* Availability Pill */
.cvm-pdp-badge-spots {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    background: #e3f5e9;
    color: #1e7e34;
}

.cvm-pdp-badge-spots.is-soldout {
    background: #fde8e8;
    color: #c82333;
}

.cvm-pdp-price-amount {
    font-size: 0.95rem;
    font-weight: 700;
    color: #111;
}


/* Label-less layout for clean modern cards */
.cvm-pdp-cards-container.cvm-pdp-no-labels .cvm-pdp-row {
    justify-content: flex-start;
}

.cvm-pdp-cards-container.cvm-pdp-no-labels .cvm-pdp-val {
    text-align: left;
}

.cvm-pdp-cards-container.cvm-pdp-no-labels .cvm-pdp-dates .cvm-pdp-val {
    font-size: 0.95rem;
    font-weight: 600;
    color: #222;
}

.cvm-pdp-cards-container.cvm-pdp-no-labels .cvm-pdp-time .cvm-pdp-val {
    font-size: 0.9rem;
    font-weight: 500;
    color: #444;
}

.cvm-pdp-cards-container.cvm-pdp-no-labels .cvm-pdp-duration .cvm-pdp-val {
    font-size: 0.85rem;
    color: #666;
}

.cvm-pdp-cards-container.cvm-pdp-no-labels .cvm-pdp-price .cvm-pdp-val {
    font-size: 1.05rem;
    font-weight: 700;
    color: #111;
    margin-top: 2px;
}

.cvm-pdp-cards-container.cvm-pdp-no-labels .cvm-pdp-spots {
    margin-top: 2px;
}


/* Granular Address Line Styles */
.cvm-pdp-address .cvm-pdp-street {
    font-size: 0.88rem;
    color: #444;
    line-height: 1.35;
    margin-top: 2px;
}

.cvm-pdp-address .cvm-pdp-locality {
    font-size: 0.82rem;
    color: #666;
    line-height: 1.3;
    margin-top: 1px;
}

.cvm-pdp-address .cvm-pdp-notes {
    font-size: 0.8rem;
    font-style: italic;
    color: #777;
    margin-top: 4px;
}

/* ==========================================================================
   PDP Location Cards - Add to Cart & Action Styles
   ========================================================================== */

/* Cart Form Container */
.cvm-pdp-cart-form {
    margin: 0 !important;
    width: 100%;
}

/* Card Register Button & Action Area */
.cvm-pdp-card-action {
    margin-top: 14px;
    padding-top: 10px;
    border-top: 1px dashed rgba(0, 0, 0, 0.1);
    display: none;
    /* Hidden by default until card is selected */
}

/* Reveal action area ONLY on the selected card */
.cvm-pdp-card.is-selected .cvm-pdp-card-action {
    display: block;
    animation: cvmPdpFadeIn 0.25s ease-out;
}

@keyframes cvmPdpFadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

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

.cvm-pdp-card-action-row {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.cvm-pdp-card-qty-wrap {
    height: 42px;
    flex-shrink: 0;
}

.cvm-pdp-card-qty-wrap .cvm-pdp-qty-btn {
    width: 32px;
    font-size: 1.1rem;
}

.cvm-pdp-card-qty-wrap .cvm-pdp-qty-input {
    width: 36px;
    font-size: 0.95rem;
}

.cvm-pdp-card-action-row .cvm-pdp-card-btn {
    flex: 1;
    height: 42px;
    padding: 0 16px;
    width: auto;
}

.cvm-pdp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.2;
    padding: 10px 18px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease-in-out;
    box-sizing: border-box;
}

.cvm-pdp-card-btn {
    width: 100%;
    background: #8c2d19;
    color: #ffffff !important;
    letter-spacing: 0.3px;
}

.cvm-pdp-card-btn:hover:not(:disabled) {
    background: #702313;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(140, 45, 25, 0.25);
    color: #ffffff !important;
}

.cvm-pdp-card-btn.is-disabled,
.cvm-pdp-card-btn:disabled {
    background: #e2e2e2 !important;
    color: #888888 !important;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.cvm-pdp-card-btn.is-loading,
.cvm-pdp-submit-btn.is-loading {
    opacity: 0.75;
    pointer-events: none;
    position: relative;
}

/* Bottom Add to Cart Bar */
.cvm-pdp-bottom-cart {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 24px;
    flex-wrap: wrap;
}

/* Hide bottom cart bar when no card is selected */
.cvm-pdp-bottom-cart.is-hidden {
    display: none !important;
}

/* Quantity Picker */
.cvm-pdp-qty-wrap {
    display: inline-flex;
    align-items: center;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
    height: 48px;
}

.cvm-pdp-qty-btn {
    width: 40px;
    height: 100%;
    background: #f7f7f7;
    border: none;
    font-size: 1.2rem;
    font-weight: 700;
    color: #333;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
    user-select: none;
}

.cvm-pdp-qty-btn:hover {
    background: #e8e8e8;
}

.cvm-pdp-qty-btn:active {
    background: #ddd;
}

.cvm-pdp-qty-input {
    width: 48px;
    height: 100%;
    border: none;
    text-align: center;
    font-size: 1.05rem;
    font-weight: 700;
    color: #222;
    background: transparent;
    -moz-appearance: textfield;
    padding: 0;
    margin: 0;
}

.cvm-pdp-qty-input::-webkit-outer-spin-button,
.cvm-pdp-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Bottom Submit Button */
.cvm-pdp-submit-btn {
    flex: 1;
    min-width: 200px;
    height: 48px;
    padding: 12px 28px;
    font-size: 1.05rem;
    font-weight: 700;
    background: #8c2d19;
    color: #ffffff !important;
    border-radius: 8px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.cvm-pdp-submit-btn:hover:not(.is-disabled) {
    background: #702313;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(140, 45, 25, 0.3);
    color: #ffffff !important;
}

.cvm-pdp-submit-btn.is-disabled {
    background: #d8d8d8 !important;
    color: #888888 !important;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Card Selection Prompt Animation */
@keyframes cvmPdpShake {

    0%,
    100% {
        transform: translateX(0);
    }

    20%,
    60% {
        transform: translateX(-6px);
    }

    40%,
    80% {
        transform: translateX(6px);
    }
}

.cvm-pdp-cards-container.cvm-pdp-highlight-needed {
    animation: cvmPdpShake 0.5s ease-in-out;
}

.cvm-pdp-cards-container.cvm-pdp-highlight-needed .cvm-pdp-card {
    border-color: #8c2d19 !important;
}

@media (max-width: 580px) {
    .cvm-pdp-bottom-cart {
        flex-direction: column;
        align-items: stretch;
    }

    .cvm-pdp-qty-wrap {
        width: 100%;
        justify-content: space-between;
    }

    .cvm-pdp-qty-input {
        flex: 1;
    }

    .cvm-pdp-submit-btn {
        width: 100%;
    }
}