/* public/assets/css/responsive.css - V5.0 Mobile Complete */

/* Mobile Only Styles (Max Width 768px) */
@media (max-width: 768px) {

    /* Prevent horizontal scroll */
    body {
        overflow-x: hidden;
    }

    /* Global Layout */
    .container {
        padding: 0 15px;
    }

    .layout-v4 {
        padding-top: 20px;
        padding-bottom: 40px;
    }

    /* 1. Header: Logo - Search - Hamburger */
    .main-header {
        height: 60px;
        padding: 0;
    }

    .header-inner {
        padding: 0 15px;
        gap: 10px;
        display: grid;
        grid-template-columns: auto 1fr auto;
        align-items: center;
    }

    .logo img {
        height: 24px;
    }

    .main-nav {
        display: none;
    }

    .header-utility.desktop-only {
        display: none;
    }

    /* Compact Search Bar */
    .header-search {
        margin: 0;
        max-width: none;
        width: 100%;
    }

    .header-search input {
        padding: 8px 12px;
        font-size: 13px;
        border-radius: 4px;
        border: 1px solid #eee;
        background: #f5f5f5;
    }

    .header-search input::placeholder {
        color: transparent;
    }

    .header-search button {
        padding: 6px 10px;
        right: 4px;
        font-size: 11px;
    }

    /* Hamburger Menu */
    .mobile-menu-btn {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        width: 24px;
        height: 18px;
        background: none;
        border: none;
        padding: 0;
        cursor: pointer;
    }

    .mobile-menu-btn span {
        display: block;
        width: 100%;
        height: 2px;
        background-color: #333;
        border-radius: 2px;
    }

    /* 2. Hero Slider - Content Below Image */
    .hero-section {
        display: flex !important;
        flex-direction: column;
        height: auto;
        margin-bottom: 30px;
        gap: 20px;
    }

    .hero-slider-container {
        display: block !important;
        height: auto;
        width: 100%;
        margin-bottom: 10px;
        min-height: auto;
        background: transparent;
        position: relative;
        /* For absolute positioning of controls */
    }

    .slider-wrapper {
        display: block !important;
        height: auto;
        width: 100%;
        position: relative;
    }

    .slide {
        display: none !important;
        position: relative;
        height: auto;
        background-size: cover;
        background-position: center;
        opacity: 1;
    }

    .slide.active {
        display: block !important;
    }

    .slide::after {
        display: none;
        /* Remove gradient overlay */
    }

    /* Slide Image Area */
    .slide::before {
        content: '';
        display: block;
        width: 100%;
        padding-bottom: 56.25%;
        /* 16:9 aspect ratio */
        background: inherit;
        background-size: cover;
        background-position: center;
        border-radius: 4px;
    }

    /* Slide Content - Below Image with Clean Background */
    .slide-content {
        position: relative;
        bottom: auto;
        left: auto;
        padding: 15px;
        background: #fff;
        /* Clean white background */
        color: #333;
        z-index: 1;
    }

    .slide-content .badge {
        background: var(--color-primary, #556B2F);
        color: #fff;
        font-size: 10px;
        padding: 3px 8px;
        margin-bottom: 8px;
    }

    .slide-content h2 {
        font-size: 20px;
        line-height: 1.4;
        color: #111;
        text-shadow: none;
        margin-bottom: 8px;
    }

    .slide-content h2 a {
        color: #111;
    }

    .slide-content .meta {
        font-size: 12px;
        color: #666;
        opacity: 1;
    }

    /* Slider Controls - Below Content (like Book Slider) */
    .slider-controls {
        position: relative;
        bottom: auto;
        left: auto;
        transform: none;
        z-index: 10;
        display: flex;
        justify-content: center;
        gap: 8px;
        align-items: center;
        margin-top: 15px;
        padding-bottom: 10px;
    }

    .slider-controls button {
        display: none;
        /* Hide arrows on mobile */
    }

    .slider-dots {
        display: flex;
        gap: 8px;
    }

    .dot {
        width: 8px;
        height: 8px;
        background: #ddd;
        border-radius: 50%;
        cursor: pointer;
        transition: all 0.3s ease;
    }

    .dot.active {
        background: #556B2F;
        width: 20px;
        border-radius: 4px;
    }

    /* Touch Swipe for Hero Slider */
    .hero-slider-container {
        touch-action: pan-y pinch-zoom;
    }

    .slider-wrapper {
        cursor: grab;
    }

    .slider-wrapper:active {
        cursor: grabbing;
    }

    /* Creators Focus */
    .creators-list-box {
        padding: 15px;
    }

    /* ========== MOBILE SLIDE-IN MENU ========== */
    .mobile-nav-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 9998;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }

    .mobile-nav-overlay.active {
        opacity: 1;
        visibility: visible;
    }

    .mobile-nav-panel {
        position: fixed;
        top: 0;
        right: -320px;
        width: 280px;
        height: 100%;
        background: #fff;
        z-index: 9999;
        transition: right 0.3s ease;
        box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
        padding: 20px;
        overflow-y: auto;
    }

    .mobile-nav-panel.active {
        right: 0;
    }

    .mobile-nav-close {
        position: absolute;
        top: 15px;
        right: 15px;
        background: none;
        border: none;
        font-size: 24px;
        cursor: pointer;
        color: #333;
    }

    .mobile-nav-panel ul {
        margin-top: 50px;
    }

    .mobile-nav-panel li {
        border-bottom: 1px solid #eee;
    }

    .mobile-nav-panel a {
        display: block;
        padding: 15px 0;
        font-size: 16px;
        font-weight: 600;
        color: #333;
    }

    .mobile-nav-panel a:hover {
        color: #556B2F;
    }

    /* 3. Now Trending */
    .section-header-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .section-title {
        font-size: 18px;
    }

    /* Tab Menu - NO SCROLL */
    .tab-menu {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        width: 100%;
        overflow: visible;
        padding-bottom: 5px;
        border-bottom: 1px solid #eee;
    }

    .tab-btn {
        flex-shrink: 0;
        padding: 8px 12px;
        font-size: 13px;
    }

    .trending-img-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .trend-thumb {
        height: 100px;
    }

    .trend-info .t-title {
        font-size: 13px;
    }

    /* 4. Recommended Books - Slider Card Style */
    .contextual-books {
        padding: 20px 15px;
        position: relative;
    }

    .books-scroller {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: scroll;
        gap: 0;
        padding-bottom: 15px;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
        /* Hide scrollbar */
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .books-scroller::-webkit-scrollbar {
        display: none;
    }

    .book-card {
        flex: 0 0 100%;
        width: 100%;
        scroll-snap-align: center;
        background: #fff;
        border: 1px solid #eee;
        border-radius: 8px;
        padding: 20px;
        display: flex;
        gap: 20px;
        align-items: flex-start;
        box-sizing: border-box;
    }

    .book-cover {
        width: 80px;
        height: 110px;
        flex-shrink: 0;
        margin-bottom: 0;
    }

    .book-info-mobile-wrapper {
        display: flex;
        flex-direction: column;
        flex: 1;
    }

    .book-card .b-title {
        font-size: 15px;
        margin-bottom: 4px;
        color: #111;
        font-weight: 700;
        display: block;
    }

    .book-card .b-author {
        font-size: 13px;
        color: #666;
        margin-bottom: 8px;
        display: block;
    }

    .book-desc-mobile {
        font-size: 11px;
        /* Match .b-desc */
        color: #777;
        line-height: 1.5;
        margin-top: 8px;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    /* Book Slider Dots */
    .book-slider-dots {
        display: flex;
        justify-content: center;
        gap: 8px;
        margin-top: 15px;
    }

    .book-dot {
        width: 8px;
        height: 8px;
        background: #ddd;
        border-radius: 50%;
        cursor: pointer;
        transition: all 0.3s ease;
    }

    .book-dot.active {
        background: #556B2F;
        width: 20px;
        border-radius: 4px;
    }
}

/* Tablet / Desktop Overrides */
@media (min-width: 769px) {
    .mobile-menu-btn {
        display: none !important;
    }

    .book-slider-dots {
        display: none;
    }

    /* Hide mobile nav on desktop */
    .mobile-nav-overlay,
    .mobile-nav-panel {
        display: none !important;
    }
}