/* ============================================
   SIR PULOH PUBLICATION - Mobile Styles
   Auto-loaded via media="(max-width: 768px)"
   ============================================ */

/* --- Navbar: Hide nav links, show hamburger --- */
.navbar-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.95);
    flex-direction: column;
    padding: 1rem 0;
    gap: 0;
    z-index: 999;
}

.navbar-nav.open {
    display: flex;
}

.navbar-nav li {
    list-style: none;
}

.navbar-nav .nav-link {
    display: block;
    padding: 0.75rem 1.5rem;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    letter-spacing: 2px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    color: #fff;
    background: rgba(45, 90, 39, 0.3);
}

/* Hide hamburger and text login on mobile */
.navbar-toggle {
    display: none !important;
}

.navbar-login-btn {
    display: none !important;
}

/* Show profile icon on mobile */
.navbar-profile-icon {
    display: flex !important;
    color: #2d5a27;
}

.navbar-profile-icon svg {
    width: 22px;
    height: 22px;
}

/* Navbar container */
.navbar-container {
    flex-wrap: nowrap;
    position: relative;
}

/* --- Bottom Tab Bar --- */
.mobile-tab-bar {
    display: flex !important;
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
    background: #fff;
    border-top: 1px solid #e5e7eb;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.08);
    z-index: 9999;
    padding: 0.35rem 0 calc(0.35rem + env(safe-area-inset-bottom));
    margin: 0 !important;
    overflow: hidden;
}

.mobile-tab {
    flex: 1 1 0 !important;
    min-width: 0 !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    text-decoration: none;
    color: #999;
    font-size: 0.6rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    padding: 0.15rem 0;
    position: relative;
    transition: color 0.2s;
}

.mobile-tab svg {
    width: 22px;
    height: 22px;
}

.mobile-tab.active {
    color: #2d5a27;
}

.mobile-tab .tab-badge {
    position: absolute;
    top: 0;
    right: calc(50% - 16px);
    background: #dc3545;
    color: #fff;
    font-size: 0.6rem;
    font-weight: 600;
    min-width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Prevent horizontal overflow on mobile */
html, body {
    overflow-x: hidden;
    max-width: 100vw;
}

/* Body padding for tab bar */
body {
    padding-bottom: 70px;
}

/* Hide footer on mobile — tab bar replaces navigation */
.footer {
    display: none !important;
}

/* Hide filter tabs, show dropdown on mobile */
.tracking-filters {
    display: none !important;
}

.tracking-filter-dropdown {
    display: block !important;
    margin-bottom: 1rem;
}

.tracking-filter-dropdown select {
    width: 100%;
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
    color: #333;
    appearance: auto;
}

/* Pages: no white gap */
.tracking-page,
.books-page {
    min-height: 100vh;
}

/* --- Hero: Add side space to glassmorphic card on mobile --- */
.hero-content {
    margin: 0 1rem;
}

/* --- Mobile Book Cards: Full Width Horizontal --- */
.books-grid {
    grid-template-columns: 1fr !important;
    gap: 0.75rem !important;
}

.book-listing-card {
    display: flex !important;
    flex-direction: row !important;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem !important;
}

.book-listing-image {
    flex: 0 0 100px;
    margin-bottom: 0 !important;
}

.book-listing-image img {
    height: 130px !important;
    width: 100px !important;
    object-fit: cover !important;
    border-radius: 6px;
}

.book-listing-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.book-listing-card .book-listing-title {
    font-size: 0.9rem;
}

.book-listing-card .book-listing-author {
    font-size: 0.75rem;
    margin-bottom: 4px;
}

.book-listing-card .book-listing-price {
    font-size: 1rem;
    margin-bottom: 6px;
}

.book-add-cart-btn {
    padding: 6px 12px !important;
    font-size: 0.7rem !important;
}

/* --- Remove old mobile nav wrapping from style.css --- */
@media (max-width: 480px) {
    .navbar-container {
        flex-wrap: nowrap;
        gap: 0;
    }

    .navbar-nav {
        order: 0;
        width: auto;
    }
}
