/* ═══ MOBILE FIXES — EduHub ═══ */

/* ── Global touch improvements ── */
@media (width < 768px) {
    body { -webkit-tap-highlight-color: transparent; }
    .container { padding-inline: 16px; }
    .topbar { font-size: 11px; padding: 4px 0; }
    .topbar-inner { gap: 6px; }
    .topbar a { font-size: 10px; }
    .lang-trigger { padding: 3px 8px; font-size: 10px; }
    .header-inner { min-height: calc(var(--logo-h, 82px) + 10px); }
    .main-nav { top: calc(var(--logo-h, 82px) + 10px) !important; }
    .main-nav.open { display: flex !important; }
    .site-logo { font-size: 22px; }
    .site-logo img, .site-logo__img { height: var(--logo-h, 82px) !important; }
    .fp-slider { min-height: 280px; height: 40vh; }
    .hero-content { padding: 0 16px; }
    .hero-content h1 { font-size: clamp(22px, 6vw, 32px); margin-bottom: 10px; }
    .hero-content p { font-size: 13px; margin-bottom: 14px; }
    .hero-buttons { gap: 8px; }
    .hero-buttons .btn { padding: 10px 20px; font-size: 10px; }
    .fp-vdots { right: 10px; padding: 5px 4px; gap: 6px; }
    .fp-vdot { width: 8px; height: 8px; }
    .fp-vdot.active { height: 22px; }
    .fp-hdots { bottom: 14px; padding: 4px 8px; gap: 6px; }
    .fp-hdot { width: 8px; height: 8px; }
    .fp-hdot.active { width: 22px; }
    .section { padding: 48px 0; }
    .section-header { margin-bottom: 28px; }
    .page-hero { padding: 20px 0; }
    .page-hero h1 { font-size: clamp(20px, 5vw, 28px); }
    .bento-card:not(.bento-card--hero) { aspect-ratio: auto; }
    .bento-card__preview { opacity: 1; transform: scale(1) translateY(0); }

    /* ── Noutăți: Hero card mobile ── */
    .bento-card--hero {
        border-radius: 14px;
    }
    .bento-hero__info {
        padding: 24px 20px 20px;
        gap: 12px;
    }
    .bento-hero__title {
        font-size: clamp(1.2rem, 5vw, 1.6rem);
    }
    .bento-hero__desc {
        font-size: 13px;
        line-height: 1.5;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    .bento-hero__price {
        font-size: 20px;
    }
    .bento-hero__cta {
        padding: 11px 24px;
        font-size: 12px;
        align-self: stretch;
        justify-content: center;
    }
    .bento-hero__image {
        padding: 20px;
        min-height: 200px;
    }
    .bento-hero__image img {
        max-height: 180px;
    }

    /* ── Noutăți: Regular cards — horizontal layout on mobile ── */
    .bento-card:not(.bento-card--hero) .bento-card__inner {
        flex-direction: row;
        height: auto;
    }
    .bento-card__image {
        min-height: 0 !important;
        width: 120px;
        min-width: 120px;
        flex: 0 0 120px;
        border-radius: 0;
    }
    .bento-card__image img {
        height: 100%;
        object-fit: cover;
    }
    .bento-card:not(.bento-card--hero) .bento-card__inner > :not(.bento-card__image) {
        flex: 1;
    }
    .bento-card__body {
        padding: 12px 14px 4px;
    }
    .bento-card__title {
        font-size: 14px;
        -webkit-line-clamp: 2;
    }
    .bento-card__desc {
        display: block !important;
        font-size: 12px;
        color: #888;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        display: -webkit-box !important;
        overflow: hidden;
    }
    .bento-card__footer {
        padding: 6px 14px 12px;
    }
    .bento-card__price {
        font-size: 14px;
    }
    .bento-card__arrow {
        width: 30px;
        height: 30px;
    }
    .bento-card__arrow svg {
        width: 14px;
        height: 14px;
    }
    /* Badge repositioned for horizontal card */
    .bento-card:not(.bento-card--hero) .bento-badge {
        top: 8px;
        left: 8px;
        padding: 3px 10px;
        font-size: 9px;
    }
    .bento-card__arrow {
        display: none;
    }
    /* Preview button — replaces arrow, positioned at footer's right side */
    .bento-card:not(.bento-card--hero) .bento-card__preview {
        top: auto;
        bottom: 12px;
        right: 14px;
        left: auto;
        width: 30px;
        height: 30px;
        transform: none;
        background: var(--navy);
        border-color: var(--navy);
    }
    .bento-card:not(.bento-card--hero) .bento-card__preview svg {
        stroke: #fff;
    }

    /* ── Preview modal mobile ── */
    .bento-preview-modal {
        width: 94%;
        max-height: 92dvh;
        border-radius: 20px;
        flex-direction: column;
    }
    .bento-preview-modal__left {
        flex: none;
        border-radius: 20px 20px 0 0;
    }
    .bento-preview-modal__image {
        min-height: 160px;
        padding: 20px;
        border-radius: 20px 20px 0 0;
    }
    .bento-preview-modal__image img {
        max-height: 180px;
    }
    .bento-preview-modal__body {
        padding: 18px 20px 22px;
        overflow-y: auto;
    }
    .bento-preview-modal__title {
        font-size: 17px;
    }
    .bento-preview-modal__desc {
        -webkit-line-clamp: 2;
        font-size: 12px;
    }
    .bento-preview-modal__price {
        font-size: 20px;
    }
    .bento-preview-modal__actions {
        flex-direction: column;
        gap: 8px;
    }
    .bento-preview-modal__actions .btn {
        width: 100%;
        text-align: center;
        justify-content: center;
        min-height: 46px;
        border-radius: 10px;
    }
    .preview-gallery__nav { width: 32px; height: 32px; font-size: 18px; }
    .preview-gallery__nav--prev { left: 6px; }
    .preview-gallery__nav--next { right: 6px; }
    .preview-gallery__thumbs { padding: 6px 12px; gap: 5px; }
    .preview-gallery__thumb { width: 44px; height: 44px; border-radius: 6px; }
    .product-card__buy { opacity: 1; transform: translateY(0); }
    .product-card__image { height: 240px; }
    .cta-card { flex-direction: column; text-align: center; padding: 20px; }
    .cta-card__left { flex-direction: column; }
    .site-footer { padding: 24px 0 0; }
    .footer-col h4 { margin-bottom: 8px; padding-bottom: 6px; }
    .contact-info-box { padding: 24px; }
    .page-content { padding: 32px 0; }

    /* ── CMS prose content: force grids to single column ── */
    .prose > div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }
    .prose > div[style*="grid-template-columns"] > div[style*="padding"] {
        padding: 24px !important;
    }
    .prose > div[style*="background"][style*="padding"] {
        padding: 28px 20px !important;
        border-radius: 10px !important;
    }
    .prose > div[style*="background"] h2 {
        font-size: 20px !important;
    }
    .prose > div[style*="background"] a[style*="padding"] {
        padding: 12px 24px !important;
        font-size: 14px !important;
    }
    .prose img {
        max-width: 100%;
        height: auto !important;
    }
    .prose iframe {
        max-width: 100%;
        height: auto;
        aspect-ratio: 16/9;
    }
    .prose table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .logo-strip__track { gap: 10px; }
    .logo-strip__item { min-width: 130px; height: 70px; padding: 10px 16px; }
    .testimonial-text { font-size: 14px; }
    .pagination { padding: 24px 0; }
    .pagination__link { min-width: 36px; height: 36px; font-size: 13px; }
}

@media (width < 400px) {
    .container { padding-inline: 12px; }
    .topbar-inner > div:first-child { font-size: 9px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 70%; }
    .hero-content h1 { font-size: 20px; }
    .hero-buttons .btn { padding: 8px 16px; font-size: 9px; }
    .bento-card__image { width: 100px !important; min-width: 100px !important; flex: 0 0 100px !important; }
    .bento-hero__info { padding: 20px 16px 16px; }
    .bento-hero__image { padding: 16px; min-height: 160px; }
    .bento-hero__image img { max-height: 150px; }
    .bento-hero__cta { padding: 10px 20px; }
}

/* ── Tablet: CMS grids 3col → 2col ── */
@media (width >= 768px) and (width < 1024px) {
    .prose > div[style*="repeat(3"] {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (hover: none) and (pointer: coarse) {
    .product-card__buy { opacity: 1; transform: translateY(0); }
    .product-card__body { transform: translateY(0); opacity: 1; }
    .bento-card__preview { opacity: 1; transform: scale(1) translateY(0); }
    .bc-note { display: none; }
}

@supports (padding: env(safe-area-inset-bottom)) {
    .site-footer .footer-bottom { padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
    .cookie-banner { padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
    .vw-bottom { padding-bottom: calc(8px + env(safe-area-inset-bottom)); }
}

/* ═══ MOBILE NAV REDESIGN ═══ */
@media (width < 900px) {

    /* ── Body lock when nav open ── */
    body.nav-open { overflow:hidden; }

    /* ── Hamburger → X ── */
    .mobile-toggle {
        position:relative; z-index:201;
        width:44px; height:44px;
        display:flex; align-items:center; justify-content:center;
    }
    .mobile-toggle svg { display:none; }
    .mobile-toggle::before,
    .mobile-toggle::after,
    .mobile-toggle span {
        content:''; position:absolute;
        width:22px; height:2px;
        background:var(--white, #fff);
        border-radius:2px;
        transition:all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    }
    .mobile-toggle::before { transform:translateY(-7px); }
    .mobile-toggle::after { transform:translateY(7px); }
    .mobile-toggle.active::before { transform:rotate(45deg); }
    .mobile-toggle.active::after { transform:rotate(-45deg); }
    .mobile-toggle.active span { opacity:0; transform:scaleX(0); }

    /* ── Dark overlay ── */
    .nav-overlay {
        position:fixed; inset:0; z-index:149;
        background:rgba(0,0,0,0);
        pointer-events:none;
        transition:background 0.35s ease;
    }
    .nav-overlay.active {
        background:rgba(0,0,0,0.5);
        pointer-events:auto;
    }

    /* ── Slide-in panel from LEFT ── */
    .main-nav {
        display:flex !important;
        position:fixed !important;
        inset:0 auto 0 0 !important;
        width:min(300px, 80vw) !important;
        background:var(--navy-dark, #0a0a14) !important;
        flex-direction:column !important;
        padding:0 !important;
        overflow-y:auto !important;
        z-index:150 !important;
        transform:translateX(-100%);
        transition:transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow:none;
        -webkit-overflow-scrolling:touch;
    }
    .main-nav.open {
        transform:translateX(0) !important;
        box-shadow:4px 0 30px rgba(0,0,0,0.4);
    }

    /* ── "MENU" label at top ── */
    .main-nav::before {
        content:'Menu';
        display:block;
        padding:22px 24px 16px;
        font-size:11px; font-weight:700;
        text-transform:uppercase; letter-spacing:2px;
        color:var(--gold, #c8a951);
        border-bottom:1px solid rgba(255,255,255,0.08);
        flex-shrink:0;
    }

    /* ── ALL links left-aligned, same style ── */
    .main-nav a {
        text-align:left !important;
        display:flex !important;
        align-items:center !important;
        justify-content:flex-start !important;
        text-transform:none !important;
        letter-spacing:normal !important;
    }
    .main-nav > a,
    .main-nav > .nav-dropdown > a {
        padding:14px 24px !important;
        font-size:14px !important;
        font-weight:500;
        color:rgba(255,255,255,0.85) !important;
        border-bottom:1px solid rgba(255,255,255,0.05) !important;
        margin:0 !important;
        opacity:0; transform:translateX(-16px);
        transition:opacity 0.3s ease, transform 0.3s ease, background 0.2s ease, color 0.2s ease;
    }
    .main-nav.open > a,
    .main-nav.open > .nav-dropdown > a {
        opacity:1; transform:translateX(0);
    }

    /* Stagger delays */
    .main-nav.open > :nth-child(1), .main-nav.open > :nth-child(1) > a { transition-delay:0.05s; }
    .main-nav.open > :nth-child(2), .main-nav.open > :nth-child(2) > a { transition-delay:0.08s; }
    .main-nav.open > :nth-child(3), .main-nav.open > :nth-child(3) > a { transition-delay:0.11s; }
    .main-nav.open > :nth-child(4), .main-nav.open > :nth-child(4) > a { transition-delay:0.14s; }
    .main-nav.open > :nth-child(5), .main-nav.open > :nth-child(5) > a { transition-delay:0.17s; }
    .main-nav.open > :nth-child(6), .main-nav.open > :nth-child(6) > a { transition-delay:0.20s; }
    .main-nav.open > :nth-child(7), .main-nav.open > :nth-child(7) > a { transition-delay:0.23s; }
    .main-nav.open > :nth-child(8), .main-nav.open > :nth-child(8) > a { transition-delay:0.26s; }
    .main-nav.open > :nth-child(9), .main-nav.open > :nth-child(9) > a { transition-delay:0.29s; }
    .main-nav.open > :nth-child(10), .main-nav.open > :nth-child(10) > a { transition-delay:0.32s; }

    /* Hover + active */
    .main-nav > a:hover,
    .main-nav > .nav-dropdown > a:hover {
        background:rgba(255,255,255,0.06) !important;
        color:#fff !important;
    }
    .main-nav > a.active {
        border-left:3px solid var(--gold, #c8a951) !important;
        color:var(--gold, #c8a951) !important;
        background:rgba(200,169,81,0.06) !important;
    }

    /* ── Dropdown container ── */
    .nav-dropdown {
        display:block !important;
        position:relative !important;
        perspective:none !important;
        padding:0 !important;
        margin:0 !important;
        width:100% !important;
        border-bottom:1px solid rgba(255,255,255,0.05);
    }
    .nav-dropdown > a {
        width:100%; position:relative;
        border-bottom:none !important;
    }

    /* Chevron on dropdown parent */
    .nav-dropdown > a::after {
        content:'' !important;
        margin-left:auto !important;
        width:7px !important; height:7px !important;
        border-right:2px solid rgba(255,255,255,0.35) !important;
        border-bottom:2px solid rgba(255,255,255,0.35) !important;
        transform:rotate(45deg) !important;
        transition:transform 0.3s ease, border-color 0.3s ease !important;
        flex-shrink:0;
        background:none !important;
        position:static !important;
        border-radius:0 !important;
    }
    .nav-dropdown.open > a {
        color:var(--gold, #c8a951) !important;
    }
    .nav-dropdown.open > a::after {
        transform:rotate(-135deg) !important;
        border-color:var(--gold, #c8a951) !important;
    }

    /* ── Submenu accordion ── */
    .nav-dropdown-menu {
        position:static !important;
        box-shadow:none !important;
        border:none !important;
        border-radius:0 !important;
        background:rgba(0,0,0,0.2) !important;
        display:block !important;
        opacity:1 !important;
        transform:none !important;
        backdrop-filter:none !important;
        -webkit-backdrop-filter:none !important;
        height:auto !important;
        max-height:0;
        overflow:hidden;
        padding:0 !important;
        transition:max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    }
    .nav-dropdown-menu::before,
    .nav-dropdown-menu::after { display:none !important; }

    .nav-dropdown.open > .nav-dropdown-menu {
        max-height:600px;
        padding:4px 0 8px !important;
    }

    /* ── Submenu items ── */
    .nav-dropdown-menu a {
        color:rgba(255,255,255,0.7) !important;
        padding:13px 24px 13px 44px !important;
        margin:0 !important;
        font-size:13px !important;
        opacity:1 !important;
        transform:none !important;
        animation:none !important;
        border-radius:0 !important;
        border-bottom:1px solid rgba(255,255,255,0.03) !important;
        transition:all 0.2s ease;
        position:relative;
        min-height:44px;
        box-sizing:border-box;
    }
    .nav-dropdown-menu a::before {
        content:'' !important;
        position:absolute !important;
        left:26px !important; top:50% !important;
        width:5px !important; height:5px !important;
        border-radius:50% !important;
        background:rgba(255,255,255,0.15) !important;
        transform:translateY(-50%) !important;
        display:block !important;
    }
    .nav-dropdown-menu a:hover {
        color:#fff !important;
        background:rgba(255,255,255,0.06) !important;
    }
    .nav-dropdown-menu a:hover::before {
        background:var(--gold, #c8a951) !important;
    }

    /* ── Bottom safe area ── */
    .main-nav::after {
        content:'';
        display:block;
        padding-bottom:env(safe-area-inset-bottom, 20px);
        min-height:20px;
        flex-shrink:0;
    }
}
