/* ============================================
   LICHIDARE.MD — Mobile Optimization v2
   Fixes: hero search input, topbar, cards, footer
   ============================================ */

/* --- HERO SEARCH FIX (critical) --- */
@media (max-width: 768px) {
    .hero-search .input-group {
        flex-direction: column !important;
        gap: 8px;
    }
    .hero-search .input-group .form-control {
        width: 100% !important;
        border-radius: 8px !important;
        min-height: 48px;
        font-size: 16px !important; /* prevents iOS zoom on focus */
        background: #fff !important;
        color: #333 !important;
        border: none !important;
        padding: 12px 16px !important;
    }
    .hero-search .input-group .btn {
        width: 100% !important;
        border-radius: 8px !important;
        min-height: 48px;
        font-size: 16px !important;
    }
}

/* --- Topbar compact --- */
@media (max-width: 768px) {
    div.top-bar-premium {
        padding: 4px 0 !important;
        font-size: 0.7rem !important;
    }
    div.top-bar-premium .top-bar-left {
        display: none !important; /* hide phone/email on mobile — save space */
    }
}

/* --- Navbar compact --- */
@media (max-width: 768px) {
    nav.navbar-premium {
        padding: 6px 0 !important;
    }
    nav.navbar-premium .brand-logo {
        height: 36px !important;
    }
    /* Hide search bar in navbar on mobile (hero has search) */
    nav.navbar-premium .nav-search,
    nav.navbar-premium form.d-flex {
        display: none !important;
    }
}

/* --- Hero section --- */
@media (max-width: 768px) {
    .hero {
        padding: 24px 0 20px !important;
    }
    .hero h1 {
        font-size: 1.5rem !important;
        line-height: 1.3 !important;
    }
    .hero p {
        font-size: 0.85rem !important;
        margin-bottom: 16px !important;
    }
    .hero-stats {
        margin-top: 16px !important;
    }
    .hero-stat-number,
    .hero .stat-number {
        font-size: 1.8rem !important;
    }
    .hero-stat-label,
    .hero .stat-label {
        font-size: 0.7rem !important;
    }
}

/* --- Category cards — 2 per row on mobile --- */
@media (max-width: 768px) {
    .category-card {
        padding: 14px 10px !important;
    }
    .category-card i {
        font-size: 1.8rem !important;
    }
    .category-card h5 {
        font-size: 0.85rem !important;
        margin-top: 6px !important;
    }
    .category-card .count {
        font-size: 0.7rem !important;
    }
}

/* --- Procedure badges --- */
@media (max-width: 768px) {
    .badge-proc,
    [class*="badge-"] {
        font-size: 0.7rem !important;
        padding: 4px 10px !important;
    }
}

/* --- Listing cards --- */
@media (max-width: 768px) {
    .listing-card {
        margin-bottom: 12px;
    }
    .listing-card-body h5 {
        font-size: 0.85rem !important;
        line-height: 1.3;
    }
    .listing-card-body h5 a {
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    .listing-card .price,
    .listing-card-body .price {
        font-size: 0.95rem !important;
    }
    .listing-card .badge {
        font-size: 0.65rem !important;
    }
}

/* --- Listing detail page --- */
@media (max-width: 768px) {
    .detail-price,
    .listing-detail .price-big {
        font-size: 1.5rem !important;
    }
    .detail-info h3,
    .listing-detail h1,
    .listing-detail h3 {
        font-size: 1.1rem !important;
    }
    .detail-gallery img {
        max-height: 300px;
        object-fit: contain;
    }
    .detail-thumbs img {
        width: 60px;
        height: 45px;
    }
    .detail-info-table td {
        font-size: 0.85rem !important;
        padding: 6px 8px !important;
    }
    /* Countdown */
    .countdown .countdown-item,
    #auctionCountdown > div {
        min-width: 50px !important;
        padding: 6px 8px !important;
    }
    #auctionCountdown > div > div:first-child {
        font-size: 1.2rem !important;
    }
    /* Sidebar stack below on mobile */
    .listing-sidebar,
    .seller-card {
        margin-top: 16px;
    }
}

/* --- Filters on listings page --- */
@media (max-width: 768px) {
    .filter-sidebar {
        margin-bottom: 16px;
    }
    .filter-sidebar .form-select,
    .filter-sidebar .form-control {
        font-size: 0.85rem !important;
    }
}

/* --- Section headings --- */
@media (max-width: 768px) {
    h2.section-title,
    .section-title {
        font-size: 1.2rem !important;
    }
}

/* --- How it works section --- */
@media (max-width: 768px) {
    .how-section .col-md-4,
    section .col-md-4.text-center {
        margin-bottom: 12px;
    }
    section .col-md-4.text-center h5 {
        font-size: 1rem !important;
    }
    section .col-md-4.text-center p {
        font-size: 0.8rem !important;
    }
}

/* --- CTA section --- */
@media (max-width: 768px) {
    section[style*="linear-gradient"] h3 {
        font-size: 1.1rem !important;
    }
    section[style*="linear-gradient"] p {
        font-size: 0.85rem !important;
    }
    .btn-accent,
    .btn-lg {
        font-size: 0.9rem !important;
        padding: 10px 24px !important;
    }
}

/* --- Footer compact --- */
@media (max-width: 768px) {
    .site-footer-premium {
        padding: 24px 0 12px !important;
    }
    .footer-title-premium {
        font-size: 0.75rem !important;
        margin-bottom: 6px !important;
    }
    .footer-links-premium a {
        font-size: 0.8rem !important;
    }
    .footer-links-premium li {
        margin-bottom: 4px !important;
    }
    .footer-brand-premium svg,
    .footer-brand-premium img {
        max-width: 140px !important;
        height: auto !important;
    }
    .footer-disclaimer-premium {
        margin-top: 16px !important;
        padding: 8px !important;
    }
    .footer-disclaimer-premium p {
        font-size: 0.65rem !important;
    }
    /* Stack footer columns */
    .site-footer-premium .col-md-3,
    .site-footer-premium .col-lg-3 {
        margin-bottom: 16px;
    }
}

/* --- Dashboard --- */
@media (max-width: 768px) {
    .dashboard-sidebar {
        margin-bottom: 16px;
    }
    .stat-card h3 {
        font-size: 1.4rem !important;
    }
    .stat-card p {
        font-size: 0.7rem !important;
    }
}

/* --- Subscribe page --- */
@media (max-width: 768px) {
    .form-check-label {
        font-size: 0.9rem;
    }
}

/* --- Contact page --- */
@media (max-width: 768px) {
    .contact-info i {
        font-size: 1.2rem;
    }
}

/* --- Very small screens (iPhone SE) --- */
@media (max-width: 375px) {
    nav.navbar-premium .brand-logo {
        height: 30px !important;
    }
    .hero h1 {
        font-size: 1.3rem !important;
    }
    .category-card h5 {
        font-size: 0.75rem !important;
    }
    .listing-card-body h5 {
        font-size: 0.8rem !important;
    }
    .hero-stat-number {
        font-size: 1.5rem !important;
    }
}

/* --- Tablet landscape --- */
@media (min-width: 769px) and (max-width: 1024px) {
    nav.navbar-premium .brand-logo {
        height: 44px !important;
    }
    .hero h1 {
        font-size: 2rem !important;
    }
}

/* --- Auction widget mobile --- */
@media (max-width: 768px) {
    .auction-live-widget {
        padding: 14px !important;
    }
    .alw-price {
        font-size: 1.5rem !important;
    }
    .alw-t-num {
        font-size: 1.1rem !important;
        padding: 4px 8px !important;
    }
    .alw-bid-form .form-control {
        font-size: 1rem !important;
    }
}

/* --- Print optimization --- */
@media print {
    div.top-bar-premium,
    nav.navbar-premium,
    .site-footer-premium,
    .site-footer,
    .btn,
    .nav-search,
    .hero-search,
    #reportModal {
        display: none !important;
    }
    main, .container {
        margin: 0 !important;
        padding: 0 !important;
        max-width: 100% !important;
    }
    .listing-detail .price-big,
    .detail-price {
        color: #000 !important;
    }
}
