/* ═══════════════════════════════════════════
   v1.15.0 — Comprehensive fixes
   1. Cruise line content: TRUE full width (no centering)
   2. Hide any sidebar on cruise line pages (belt-and-suspenders)
   3. Mobile-responsive: deal page, cruise lines listing, review deal columns
   4. Topbar middle: properly centered
   ═══════════════════════════════════════════ */


/* ─── 1. CRUISE LINE: TRUE full-width content (no max-width constraint) ─── */

.act-cruise-line-content {
    display: block;
    width: 100%;
    max-width: 100%;
    margin: 0;
}

.act-cruise-line-content .act-article,
.act-cruise-line-content .act-article--full {
    width: 100%;
    max-width: 100%;
}

.act-cruise-line-content .act-article-content,
.act-cruise-line-content .act-article-content > * {
    max-width: 100%;
}

/* v1.23: Override the > * max-width:100% above for embedded breakout heroes.
   The .act-tpl-hero / .act-page-hero blocks inside cruise-line content use
   width:100vw + negative margins to span the full viewport. The > * rule
   above was clipping them to the constrained parent width. */
.act-cruise-line-content .act-article-content > .act-tpl-hero,
.act-cruise-line-content .act-article-content > .act-page-hero,
.act-cruise-line-content .act-article-content .act-tpl-hero,
.act-cruise-line-content .act-article-content .act-page-hero {
    max-width: none;
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    box-sizing: border-box;
}

.act-cruise-line-content .act-quick-facts {
    display: grid;
    grid-template-columns: repeat( auto-fit, minmax( 140px, 1fr ) );
    gap: 24px;
    background: #0F172A;
    color: #fff;
    padding: 28px 32px;
    border-radius: 14px;
    margin: 0 0 32px;
}

.act-cruise-line-content .act-quick-fact__label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba( 255, 255, 255, 0.6 );
    margin-bottom: 4px;
}

.act-cruise-line-content .act-quick-fact__value {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
}


/* ─── 2. HIDE ANY SIDEBAR ON CRUISE LINE PAGES (defence-in-depth) ─── */

body.single-act_cruise_line .act-sidebar,
body.single-act_cruise_line aside.widget-area,
body.single-act_cruise_line aside.act-sidebar,
body.post-type-archive-act_cruise_line .act-sidebar {
    display: none !important;
}

/* Force the content-sidebar wrapper to be single-column on cruise line pages,
   in case any template still uses .act-content-sidebar wrapper */
body.single-act_cruise_line .act-content-sidebar {
    display: block !important;
    grid-template-columns: 1fr !important;
    max-width: 100% !important;
}

body.single-act_cruise_line .act-content-sidebar > article {
    width: 100% !important;
    max-width: 100% !important;
}


/* ─── 3. HERO SUBTITLE: readable on dark gradient ─── */

.act-page-hero__subtitle,
.act-page-hero p.act-page-hero__subtitle,
.act-page-hero div.act-page-hero__subtitle {
    color: rgba( 255, 255, 255, 0.92 ) !important;
    font-size: clamp( 1rem, 1.4vw, 1.15rem );
    line-height: 1.6;
    font-weight: 400;
    max-width: 760px;
    margin: 16px 0 24px;
    text-shadow: 0 1px 2px rgba( 0, 0, 0, 0.15 );
}

.act-page-hero__title {
    color: #fff;
    text-shadow: 0 2px 4px rgba( 0, 0, 0, 0.2 );
}

.act-page-hero__meta-item {
    color: rgba( 255, 255, 255, 0.95 );
    font-size: 14px;
    font-weight: 500;
}


/* ─── 4. CDM CRUISE LINES LISTING — mobile responsive ─── */
/* The shortcode outputs INLINE grid-template-columns:repeat(N,1fr).
   Use !important to override inline styles on small screens. */

@media ( max-width: 1024px ) {
    .cdm-lines-grid[data-cols="6"],
    .cdm-lines-grid[data-cols="5"],
    .cdm-lines-grid[data-cols="4"] {
        grid-template-columns: repeat( 3, 1fr ) !important;
    }
}

@media ( max-width: 768px ) {
    .cdm-lines-grid,
    .cdm-lines-grid[data-cols] {
        grid-template-columns: repeat( 2, 1fr ) !important;
        gap: 16px !important;
    }
    .cdm-line-card {
        font-size: 14px;
    }
    .cdm-line-card img {
        max-height: 60px !important;
    }
    .cdm-line-card h3 {
        font-size: 16px !important;
    }
}

@media ( max-width: 480px ) {
    .cdm-lines-grid,
    .cdm-lines-grid[data-cols] {
        grid-template-columns: 1fr !important;
    }
    .cdm-line-card > div:first-child {
        height: 100px !important;
        padding: 16px !important;
    }
}


/* ─── 5. CDM DEALS GRID — mobile responsive ─── */
/* Same approach: override inline grid-template-columns */

@media ( max-width: 1024px ) {
    .cdm-deals-grid[data-cols="4"],
    .cdm-deals-grid[data-cols="3"] {
        grid-template-columns: repeat( 2, 1fr ) !important;
    }
}

@media ( max-width: 600px ) {
    .cdm-deals-grid,
    .cdm-deals-grid[data-cols] {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }
    .cdm-deal-card {
        font-size: 14px;
    }
    .cdm-deal-card h3,
    .cdm-deal-card h2 {
        font-size: 18px !important;
        line-height: 1.3 !important;
    }
}


/* ─── 6. SINGLE DEAL PAGE — mobile responsive ─── */
/* single-act_deal.php has inline grid-template-columns:1fr auto and
   grid-template-columns:repeat(3,1fr) all over. Override on mobile. */

@media ( max-width: 768px ) {
    /* Price-box card: was "1fr auto" (price | button), stack vertically */
    .single-act_deal .act-content-sidebar > article > div[style*="grid-template-columns:1fr auto"],
    .single-act_deal article > div[style*="grid-template-columns: 1fr auto"] {
        grid-template-columns: 1fr !important;
        text-align: left !important;
        padding: 24px !important;
    }

    /* 3-column deal facts grid: 2 columns on tablet */
    .single-act_deal article > div[style*="grid-template-columns:repeat(3,1fr)"],
    .single-act_deal article > div[style*="grid-template-columns: repeat(3, 1fr)"] {
        grid-template-columns: repeat( 2, 1fr ) !important;
        gap: 12px !important;
    }

    /* Hero price - 48px is too big on mobile */
    .single-act_deal div[style*="font-size:48px"] {
        font-size: 36px !important;
    }

    /* CTA button - full width on mobile */
    .single-act_deal .act-btn--lg {
        display: block !important;
        text-align: center !important;
        margin-top: 12px;
    }

    /* Content-sidebar wrapper - collapse to single column */
    .single-act_deal .act-content-sidebar {
        display: block !important;
        grid-template-columns: 1fr !important;
    }

    .single-act_deal .act-sidebar {
        margin-top: 32px;
    }
}

@media ( max-width: 480px ) {
    /* 3-column deal facts grid: 1 column on phone */
    .single-act_deal article > div[style*="grid-template-columns:repeat(3,1fr)"],
    .single-act_deal article > div[style*="grid-template-columns: repeat(3, 1fr)"] {
        grid-template-columns: 1fr !important;
    }

    .single-act_deal div[style*="font-size:48px"] {
        font-size: 30px !important;
    }

    .single-act_deal article > div[style*="padding:36px"] {
        padding: 20px !important;
    }
}


/* ─── 7. COMPARISON TABLE — horizontal scroll on mobile + sticky first column ─── */

@media ( max-width: 900px ) {
    .cc-compare-wrap,
    .act-compare-result__body,
    .cruisecompare-compare-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        position: relative;
    }

    .cc-compare-wrap table,
    .act-compare-result__body table,
    .cruisecompare-compare-wrap table {
        min-width: 600px;
        font-size: 13px;
    }

    .cc-compare-wrap th:first-child,
    .cc-compare-wrap td:first-child,
    .act-compare-result__body th:first-child,
    .act-compare-result__body td:first-child {
        position: sticky;
        left: 0;
        background: #fff;
        z-index: 2;
        box-shadow: 1px 0 0 #E5E7EB;
        font-size: 12px;
        font-weight: 600;
    }

    .cc-compare-wrap th,
    .cc-compare-wrap td,
    .act-compare-result__body th,
    .act-compare-result__body td {
        padding: 8px 10px !important;
    }

    .cc-verdict {
        padding: 20px 18px !important;
        margin: 16px 0 !important;
    }

    .cc-verdict-header h3 {
        font-size: 1.1rem !important;
    }
}

@media ( max-width: 600px ) {
    .cc-compare-wrap table,
    .act-compare-result__body table {
        min-width: 480px;
        font-size: 12px;
    }
    .cc-compare-wrap th:first-child,
    .cc-compare-wrap td:first-child {
        max-width: 100px;
    }
}


/* ─── 8. PAGE HERO — scale on mobile ─── */

@media ( max-width: 768px ) {
    .act-page-hero {
        padding: 32px 0;
    }
    .act-page-hero__title {
        font-size: clamp( 1.6rem, 6vw, 2rem );
        line-height: 1.2;
    }
    .act-page-hero__subtitle {
        font-size: 0.95rem;
        line-height: 1.5;
    }
    .act-page-hero__meta {
        gap: 10px;
        flex-wrap: wrap;
    }
    .act-page-hero__meta-item {
        font-size: 13px;
    }
}


/* ─── 9. CRUISE LINE QUICK FACTS — responsive ─── */

@media ( max-width: 600px ) {
    .act-cruise-line-content .act-quick-facts {
        grid-template-columns: 1fr 1fr;
        padding: 20px;
        gap: 16px;
    }
    .act-cruise-line-content .act-quick-fact__value {
        font-size: 15px;
    }
}

@media ( max-width: 380px ) {
    .act-cruise-line-content .act-quick-facts {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}


/* ─── 10. ARTICLE CONTENT — mobile padding ─── */

@media ( max-width: 600px ) {
    .act-article,
    .act-article-content {
        padding: 0;
    }
    .act-article-content h2 {
        font-size: 1.4rem;
        margin-top: 1.5rem;
    }
    .act-article-content h3 {
        font-size: 1.2rem;
    }
    .act-article-content p {
        font-size: 0.95rem;
        line-height: 1.65;
    }
    .act-container {
        padding-left: 16px;
        padding-right: 16px;
    }
}


/* ─── 11. SAVED ITEMS GRID — mobile ─── */

@media ( max-width: 700px ) {
    .act-saved-grid {
        grid-template-columns: 1fr 1fr !important;
    }
}

@media ( max-width: 480px ) {
    .act-saved-grid {
        grid-template-columns: 1fr !important;
    }
    .act-saved-stats {
        flex-wrap: wrap;
        gap: 8px;
    }
    .act-saved-stat {
        flex: 1 1 calc( 50% - 4px );
        min-width: 0;
        padding: 10px 8px;
    }
}


/* ─── 12. TOPBAR MIDDLE — properly centered rotating messages ─── */

.act-topbar-inner {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 16px;
    align-items: center;
    position: relative;
}

.act-topbar-left { justify-self: start; }
.act-topbar-right { justify-self: end; display: flex; align-items: center; gap: 12px; }

.act-topbar-middle {
    justify-self: center;
    position: relative;
    min-width: 340px;
    height: 1.4em;
    text-align: center;
    color: rgba( 255, 255, 255, 0.85 );
    font-size: 13px;
}

.act-topbar-rotator {
    position: relative;
    width: 100%;
    height: 100%;
    display: block;
}

.act-topbar-rotator__slide {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate( -50%, -50% );
    opacity: 0;
    transition: opacity 0.5s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    pointer-events: none;
}

.act-topbar-rotator__slide.is-active {
    opacity: 1;
    pointer-events: auto;
}

.act-topbar-rotator__slide svg {
    opacity: 0.7;
    flex-shrink: 0;
}

.act-topbar-account,
.act-topbar-signin {
    color: #FCD34D !important;
    font-weight: 600;
}
.act-topbar-account:hover,
.act-topbar-signin:hover {
    color: #fff !important;
}

@media ( max-width: 900px ) {
    .act-topbar-middle { display: none; }
    .act-topbar-inner { grid-template-columns: 1fr auto; }
}
