/**
 * Workshops Mobile Fixes
 *
 * @package NightGlass
 * @since 2.0.0
 */

@media (max-width: 768px) {

    /* =======================================================================
       Allow scrolling on page
       ======================================================================= */

    /* Removed overflow rules - was blocking touch scroll on mobile */

    /* =======================================================================
       Sticky Filter Bar
       ======================================================================= */

    .workshops-filter-v2,
    .workshops-page .page-filter {
        position: sticky !important;
        top: 0 !important;
        z-index: 50 !important;
        background: rgba(10, 10, 12, 0.95) !important;
        backdrop-filter: blur(12px) !important;
        -webkit-backdrop-filter: blur(12px) !important;
        padding: 0.75rem 1rem !important;
        margin: 0 !important;
    }

    /* Filter pills - smaller, scroll horizontally */
    .workshops-filter-v2 .page-filter__inner,
    .workshops-page .page-filter__inner {
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        gap: 0.5rem !important;
        padding-bottom: 0.25rem !important;
    }

    .workshops-filter-v2 .page-filter__pill--tier1,
    .workshops-page .page-filter__pill--tier1 {
        flex-shrink: 0 !important;
        padding: 0.5rem 0.75rem !important;
        font-size: 0.75rem !important;
    }

    /* View toggle - compact */
    .workshops-view-toggle {
        flex-shrink: 0 !important;
    }

    .workshops-view-toggle__btn {
        padding: 0.375rem 0.625rem !important;
        font-size: 0.6875rem !important;
    }

    /* =======================================================================
       Featured Workshop - Mobile Hero
       Fits within one viewport with all key info
       ======================================================================= */

    .featured-workshop {
        padding: 1.5rem 1rem !important;
        margin-bottom: 1.5rem !important;
    }

    .featured-workshop__inner {
        gap: 1.25rem !important;
    }

    /* Controlled image height - max 45vh */
    .featured-workshop__media {
        max-height: 45vh !important;
        max-width: 100% !important;
        margin: 0 !important;
        border-radius: 10px !important;
        overflow: hidden !important;
    }

    .featured-workshop__media img {
        width: 100% !important;
        height: 100% !important;
        max-height: 45vh !important;
        object-fit: cover !important;
    }

    /* Badges - smaller on mobile */
    .featured-workshop__badges {
        top: 0.75rem !important;
        left: 0.75rem !important;
        gap: 0.5rem !important;
    }

    .featured-workshop .badge {
        padding: 0.375rem 0.625rem !important;
        font-size: 0.625rem !important;
    }

    /* Content - tighter spacing */
    .featured-workshop__content {
        gap: 0.125rem !important;
    }

    .featured-workshop__type {
        font-size: 0.6875rem !important;
        letter-spacing: 0.12em !important;
    }

    .featured-workshop__title {
        font-size: 1.375rem !important;
        line-height: 1.15 !important;
    }

    .featured-workshop__date-row {
        margin: 0.375rem 0 0.625rem !important;
        gap: 0.5rem !important;
    }

    .featured-workshop__dates {
        font-size: 0.875rem !important;
    }

    .featured-workshop__season-badge,
    .featured-workshop__guaranteed-badge {
        font-size: 0.625rem !important;
        padding: 0.1875rem 0.5rem !important;
    }

    .featured-workshop__facts-line {
        font-size: 0.8125rem !important;
        margin: 0 0 0.625rem !important;
    }

    /* Hide description on mobile - key facts are enough */
    .featured-workshop__description {
        display: none !important;
    }

    /* Facts row - compact */
    .featured-workshop__facts {
        gap: 0.75rem !important;
        margin-bottom: 0.875rem !important;
    }

    .featured-workshop__fact {
        font-size: 0.75rem !important;
        gap: 0.375rem !important;
    }

    .featured-workshop__fact svg {
        width: 14px !important;
        height: 14px !important;
    }

    /* Hide quote on mobile - saves significant space */
    .featured-workshop__quote {
        display: none !important;
    }

    /* Action row - keep horizontal for prominence */
    .featured-workshop__action-row {
        flex-direction: row !important;
        align-items: flex-start !important;
        justify-content: space-between !important;
        gap: 1rem !important;
        margin-top: 0.5rem !important;
    }

    .featured-workshop__pricing {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.125rem !important;
    }

    .featured-workshop__price {
        font-size: 1.375rem !important;
    }

    .featured-workshop__deposit {
        font-size: 0.75rem !important;
    }

    .featured-workshop__cta {
        padding: 0.75rem 1.25rem !important;
        font-size: 0.75rem !important;
        white-space: nowrap !important;
    }

    /* =======================================================================
       Timeline View: Vertical Spine Design
       Luxury glass cards with compact hierarchy
       ======================================================================= */

    .workshops-timeline {
        padding: 1rem 1rem 1.25rem 0 !important;
        position: relative !important;
    }

    .workshops-timeline::before {
        display: block !important;
        content: '' !important;
        position: absolute !important;
        left: 18px !important;
        top: 0 !important;
        bottom: 0 !important;
        width: 2px !important;
        background: linear-gradient(
            to bottom,
            transparent 0%,
            rgba(255, 255, 255, 0.18) 6%,
            rgba(255, 255, 255, 0.18) 94%,
            transparent 100%
        ) !important;
    }

    .workshops-timeline__year {
        position: relative !important;
        transform: none !important;
        display: inline-block !important;
        margin-bottom: 1rem !important;
        margin-left: 44px !important;
        z-index: 2 !important;
    }

    .workshops-timeline__month {
        margin-bottom: 1rem !important;
        position: relative !important;
    }

    .workshops-timeline__month-header {
        margin-bottom: 0.5rem !important;
        margin-left: 44px !important;
    }

    .workshops-timeline__month-label {
        font-size: 0.75rem !important;
        font-weight: 600 !important;
        text-transform: uppercase !important;
        letter-spacing: 0.1em !important;
        color: var(--wp--preset--color--text-muted) !important;
        opacity: 0.6 !important;
    }

    .workshops-timeline__items {
        display: flex !important;
        flex-direction: column !important;
        gap: 0.75rem !important;
        padding-left: 44px !important;
        margin: 0 !important;
    }

    .workshops-timeline__dot {
        display: flex !important;
        position: absolute !important;
        left: -42px !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        width: 32px !important;
        height: 32px !important;
        border-radius: 50% !important;
        background: rgba(10, 10, 12, 0.7) !important;
        border: 1px solid rgba(255, 255, 255, 0.25) !important;
        align-items: center !important;
        justify-content: center !important;
        z-index: 2 !important;
        overflow: hidden !important;
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35) !important;
    }

    .workshops-timeline__dot img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        border-radius: 50% !important;
        display: block !important;
    }

    .workshops-timeline__item--landscape .workshops-timeline__dot {
        border-color: var(--workshop-color-landscape, #7ed17e) !important;
    }

    .workshops-timeline__item--wildlife .workshops-timeline__dot {
        border-color: var(--workshop-color-wildlife, #e6b84d) !important;
    }

    .workshops-timeline__item--astro .workshops-timeline__dot {
        border-color: var(--workshop-color-astro, #a78bfa) !important;
    }

    .workshops-timeline__item--private .workshops-timeline__dot {
        border-color: rgba(255, 255, 255, 0.25) !important;
        border-style: dashed !important;
    }

    .workshops-timeline__dot::after {
        display: none !important;
    }

    .workshops-timeline__item {
        display: flex !important;
        flex-direction: row !important;
        align-items: stretch !important;
        background: linear-gradient(
            135deg,
            rgba(255, 255, 255, 0.06) 0%,
            rgba(255, 255, 255, 0.02) 100%
        ) !important;
        border: 1px solid rgba(255, 255, 255, 0.08) !important;
        border-radius: 12px !important;
        overflow: visible !important;
        transition: all 0.2s ease !important;
        position: relative !important;
        min-height: 88px !important;
        backdrop-filter: blur(14px) !important;
        -webkit-backdrop-filter: blur(14px) !important;
        box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35) !important;
    }

    .workshops-timeline__item:hover {
        background: linear-gradient(
            135deg,
            rgba(255, 255, 255, 0.08) 0%,
            rgba(255, 255, 255, 0.03) 100%
        ) !important;
        border-color: rgba(255, 255, 255, 0.15) !important;
        transform: translateY(-1px) !important;
    }

    .workshops-timeline__bar {
        display: flex !important;
        flex-direction: row !important;
        flex: 1 !important;
        padding: 0.85rem 0.9rem !important;
        gap: 0.75rem !important;
        background: transparent !important;
        border: none !important;
        border-radius: 0 !important;
        align-items: center !important;
    }

    .workshops-timeline__image-stub {
        width: 40px !important;
        height: 40px !important;
        border-radius: 10px !important;
        overflow: hidden !important;
        flex-shrink: 0 !important;
        background: rgba(255, 255, 255, 0.05) !important;
        border: 1px solid rgba(255, 255, 255, 0.08) !important;
        box-shadow: 0 8px 18px rgba(0, 0, 0, 0.3) !important;
    }

    .workshops-timeline__image-stub img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        display: block !important;
    }

    .workshops-timeline__content {
        flex: 1 !important;
        min-width: 0 !important;
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) auto !important;
        column-gap: 0.75rem !important;
        align-items: start !important;
    }

    .workshops-timeline__body {
        min-width: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 0.3rem !important;
    }

    .workshops-timeline__header {
        display: flex !important;
        flex-wrap: wrap !important;
        align-items: baseline !important;
        gap: 0.35rem 0.5rem !important;
    }

    .workshops-timeline__date {
        display: inline-flex !important;
        position: static !important;
        transform: none !important;
        align-items: center !important;
        gap: 0.35rem !important;
        padding: 0.35rem 0.55rem !important;
        border-radius: 999px !important;
        background: rgba(255, 255, 255, 0.06) !important;
        border: 1px solid rgba(255, 255, 255, 0.12) !important;
        font-size: 0.625rem !important;
        font-weight: 600 !important;
        text-transform: uppercase !important;
        letter-spacing: 0.08em !important;
        color: var(--wp--preset--color--text-muted) !important;
        width: auto !important;
        margin: 0 !important;
        flex-shrink: 0 !important;
    }

    .workshops-timeline__date-month-vertical {
        writing-mode: horizontal-tb !important;
        text-orientation: mixed !important;
        padding: 0 !important;
        font-size: 0.625rem !important;
        font-weight: 600 !important;
        color: inherit !important;
        text-transform: uppercase !important;
        letter-spacing: 0.08em !important;
        background: transparent !important;
        border-right: none !important;
    }

    .workshops-timeline__date-days {
        display: inline-flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 0.25rem !important;
        padding: 0 !important;
    }

    .workshops-timeline__date-days-row {
        display: inline-flex !important;
        align-items: center !important;
        gap: 0.25rem !important;
    }

    .workshops-timeline__date-day-block {
        display: inline-flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 0.2rem !important;
        padding: 0 !important;
    }

    .workshops-timeline__date-num {
        font-size: 0.75rem !important;
        font-weight: 600 !important;
        color: var(--wp--preset--color--text-primary) !important;
        line-height: 1 !important;
    }

    .workshops-timeline__date-dow {
        display: none !important;
    }

    .workshops-timeline__date-sep {
        font-size: 0.75rem !important;
        font-weight: 400 !important;
        color: var(--wp--preset--color--text-muted) !important;
        padding: 0 0.1rem !important;
        line-height: 1 !important;
        margin: 0 !important;
    }

    .workshops-timeline__date-month-end {
        font-size: 0.625rem !important;
        font-weight: 600 !important;
        color: var(--wp--preset--color--text-muted) !important;
        text-transform: uppercase !important;
        letter-spacing: 0.08em !important;
        margin-left: 0.25rem !important;
        opacity: 0.8 !important;
    }

    .workshops-timeline__date::after,
    .workshops-timeline__date::before {
        display: none !important;
    }

    .workshops-timeline__title {
        font-family: var(--wp--preset--font-family--heading) !important;
        font-size: 1rem !important;
        font-weight: 600 !important;
        line-height: 1.25 !important;
        margin-bottom: 0 !important;
        color: var(--wp--preset--color--text-primary) !important;
        display: -webkit-box !important;
        -webkit-line-clamp: 2 !important;
        -webkit-box-orient: vertical !important;
        overflow: hidden !important;
    }

    .workshops-timeline__meta {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 0.25rem 0.5rem !important;
        margin: 0 !important;
        font-size: 0.6875rem !important;
        color: var(--wp--preset--color--text-muted) !important;
        line-height: 1.4 !important;
    }

    .workshops-timeline__meta span:not(.workshops-timeline__type-pill)::after {
        margin-left: 0.5rem !important;
    }

    .workshops-timeline__type-pill {
        font-size: 0.5625rem !important;
        padding: 0.15rem 0.45rem !important;
        letter-spacing: 0.06em !important;
        border-radius: 4px !important;
    }

    .workshops-timeline__actions {
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-end !important;
        justify-content: center !important;
        gap: 0.2rem !important;
        padding-left: 0.75rem !important;
        border-left: 1px solid rgba(255, 255, 255, 0.08) !important;
        margin-left: auto !important;
        flex-shrink: 0 !important;
    }

    .workshops-timeline__price {
        font-size: 0.9375rem !important;
        font-weight: 700 !important;
        color: var(--wp--preset--color--text-primary) !important;
        white-space: nowrap !important;
        letter-spacing: 0.01em !important;
    }

    .workshops-timeline__cta {
        font-size: 0.6rem !important;
        text-transform: uppercase !important;
        letter-spacing: 0.1em !important;
        opacity: 0.75 !important;
    }

    .workshops-timeline__item:hover .workshops-timeline__cta {
        opacity: 1 !important;
    }

    .workshops-timeline__badge--guaranteed,
    .workshops-timeline__badge--soldout {
        font-size: 0.5625rem !important;
        padding: 0.125rem 0.5rem !important;
        border-radius: 999px !important;
    }

    /* =======================================================================
       Private Workshops in Timeline
       ======================================================================= */

    .workshops-timeline__item--private,
    .workshops-section--partner .workshops-timeline__item {
        background: rgba(255, 255, 255, 0.02) !important;
        border-style: dashed !important;
    }

    /* =======================================================================
       Past Workshops - Collapsible on Mobile
       ======================================================================= */

    .workshops-section--past {
        border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
        padding-top: 1.5rem !important;
    }

    .workshops-section--past .workshops-section__header {
        cursor: pointer !important;
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
    }

    .workshops-section--past .workshops-section__header::after {
        content: '▼' !important;
        font-size: 0.75rem !important;
        opacity: 0.5 !important;
        transition: transform 0.2s ease !important;
    }

    .workshops-section--past.is-collapsed .workshops-section__header::after {
        transform: rotate(-90deg) !important;
    }

    .workshops-section--past.is-collapsed .workshops-section__content,
    .workshops-section--past.is-collapsed .workshops-timeline {
        display: none !important;
    }

    /* =======================================================================
       Tutorials Section - 2-up Grid
       ======================================================================= */

    .workshops-section--tutorials .workshops-timeline__items,
    .tutorials-grid {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.75rem !important;
        padding-left: 0 !important;
    }

    .workshops-section--tutorials .workshops-timeline__item,
    .tutorial-card {
        padding: 0 !important;
    }

    .workshops-section--tutorials .workshops-timeline__thumb,
    .tutorial-card__thumb {
        aspect-ratio: 16/9 !important;
    }

    .workshops-section--tutorials .workshops-timeline__title,
    .tutorial-card__title {
        font-size: 0.8125rem !important;
        line-height: 1.3 !important;
    }

    .workshops-section--tutorials .workshops-timeline__bar,
    .tutorial-card__content {
        padding: 0.625rem !important;
    }

    /* =======================================================================
       Standard Workshop Cards (non-timeline view)
       ======================================================================= */

    .workshop-cards,
    .workshops-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 1.5rem !important;
        padding: 0 1rem !important;
    }

    .workshop-card {
        width: 100% !important;
        max-width: 100% !important;
    }

    .workshop-card__image,
    .workshop-card img {
        width: 100% !important;
        height: auto !important;
        aspect-ratio: 16/9 !important;
        object-fit: cover !important;
    }

    .workshop-card__content {
        padding: 1rem !important;
    }

    .workshop-card__title {
        font-size: 1.25rem !important;
    }

    .workshop-card__meta {
        font-size: 0.875rem !important;
    }

    /* =======================================================================
       Single Workshop Page
       ======================================================================= */

    /* Allow scroll on single workshop pages */
    .single-product.product-type-workshop {
        /* overflow-x removed - was blocking scroll */
    }

    .workshop-hero,
    .workshop-header {
        padding: 1rem !important;
    }

    .workshop-hero__title,
    .workshop-title {
        font-size: 1.5rem !important;
    }

    .workshop-details {
        display: flex !important;
        flex-direction: column !important;
        gap: 1rem !important;
        padding: 1rem !important;
    }

    .workshop-sidebar {
        order: 2 !important;
        width: 100% !important;
    }

    .workshop-content {
        order: 1 !important;
    }

    .workshop-booking-form,
    .booking-calendar {
        width: 100% !important;
        padding: 1rem !important;
    }

    .deposit-info {
        padding: 1rem !important;
        font-size: 0.875rem !important;
    }
}

@media (max-width: 480px) {
    .workshop-card__title {
        font-size: 1.125rem !important;
    }

    .workshop-hero__title,
    .workshop-title {
        font-size: 1.25rem !important;
    }

    /* =======================================================================
       Featured Workshop - Small Phone Adjustments
       ======================================================================= */

    .featured-workshop {
        padding: 1rem !important;
    }

    .featured-workshop__media {
        max-height: 40vh !important;
        border-radius: 8px !important;
    }

    .featured-workshop__media img {
        max-height: 40vh !important;
    }

    .featured-workshop__title {
        font-size: 1.25rem !important;
    }

    .featured-workshop__facts {
        flex-direction: column !important;
        gap: 0.5rem !important;
    }

    .featured-workshop__price {
        font-size: 1.25rem !important;
    }

    .featured-workshop__cta {
        padding: 0.625rem 1rem !important;
        font-size: 0.6875rem !important;
    }

    /* =======================================================================
       Timeline - Small Phone Adjustments
       ======================================================================= */

    .workshops-timeline {
        padding: 0.75rem 0.75rem 1rem 0 !important;
    }

    .workshops-timeline::before {
        left: 16px !important;
    }

    .workshops-timeline__year {
        margin-left: 40px !important;
    }

    .workshops-timeline__month-header {
        margin-left: 40px !important;
    }

    .workshops-timeline__items {
        gap: 0.7rem !important;
        padding-left: 40px !important;
    }

    .workshops-timeline__dot {
        width: 28px !important;
        height: 28px !important;
        left: -38px !important;
    }

    .workshops-timeline__image-stub {
        width: 36px !important;
        height: 36px !important;
    }

    .workshops-timeline__bar {
        padding: 0.75rem 0.75rem !important;
    }

    .workshops-timeline__date {
        font-size: 0.6rem !important;
        padding: 0.3rem 0.5rem !important;
    }

    .workshops-timeline__date-num {
        font-size: 0.7rem !important;
    }

    .workshops-timeline__title {
        font-size: 0.9375rem !important;
    }

    .workshops-timeline__meta {
        font-size: 0.65rem !important;
    }

    .workshops-timeline__price {
        font-size: 0.875rem !important;
    }

    .workshops-timeline__cta {
        font-size: 0.55rem !important;
    }

    /* Tutorials - still 2-up but tighter */
    .workshops-section--tutorials .workshops-timeline__title,
    .tutorial-card__title {
        font-size: 0.75rem !important;
    }
}

/* =============================================================================
   Day Glass (Light Theme) Mobile Overrides
   ============================================================================= */

@media (max-width: 768px) {
    /* Featured Workshop - Day Glass */
    [data-theme="light"] .featured-workshop {
        background: linear-gradient(
            135deg,
            rgba(245, 245, 245, 0.98) 0%,
            rgba(250, 250, 250, 0.99) 100%
        ) !important;
    }

    [data-theme="light"] .featured-workshop::after {
        background: linear-gradient(to bottom, transparent 0%, #f9f9f8 100%) !important;
    }

    [data-theme="light"] .featured-workshop__media {
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12) !important;
    }

    /* Timeline: Day Glass overrides */
    [data-theme="light"] .workshops-timeline::before {
        background: linear-gradient(
            to bottom,
            transparent 0%,
            rgba(0, 0, 0, 0.12) 6%,
            rgba(0, 0, 0, 0.12) 94%,
            transparent 100%
        ) !important;
    }

    [data-theme="light"] .workshops-timeline__dot {
        background: #fff !important;
        border-color: rgba(0, 0, 0, 0.2) !important;
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15) !important;
    }

    [data-theme="light"] .workshops-timeline__item {
        background: #fff !important;
        border-color: rgba(0, 0, 0, 0.1) !important;
        box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08) !important;
    }

    [data-theme="light"] .workshops-timeline__item:hover {
        background: #fff !important;
        border-color: rgba(0, 0, 0, 0.16) !important;
        box-shadow: 0 8px 22px rgba(0, 0, 0, 0.12) !important;
    }

    [data-theme="light"] .workshops-timeline__image-stub {
        background: #fff !important;
        border-color: rgba(0, 0, 0, 0.1) !important;
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12) !important;
    }

    [data-theme="light"] .workshops-timeline__date {
        background: rgba(0, 0, 0, 0.04) !important;
        border-color: rgba(0, 0, 0, 0.08) !important;
        color: rgba(0, 0, 0, 0.6) !important;
    }

    [data-theme="light"] .workshops-timeline__date-num {
        color: rgba(0, 0, 0, 0.9) !important;
    }

    [data-theme="light"] .workshops-timeline__actions {
        border-left-color: rgba(0, 0, 0, 0.08) !important;
    }

    /* Private workshops - Day Glass */
    [data-theme="light"] .workshops-timeline__item--private,
    [data-theme="light"] .workshops-section--partner .workshops-timeline__item {
        background: rgba(0, 0, 0, 0.02) !important;
    }

    /* Past workshops border - Day Glass */
    [data-theme="light"] .workshops-section--past {
        border-top-color: rgba(0, 0, 0, 0.1) !important;
    }
}
