/* Mobile-first overrides for low-end devices */
:root {
    --header-height: 48px;
    --bottom-nav-height: 56px;
}

/* Hide desktop-only UI on mobile */
header .desktop-search { display: none !important; }
.site-footer { display: none !important; }
header .nav-links .btn-warning { display: none !important; }
header .nav-links a[href="index.php"],
header .nav-links a[href="reels.php"],
header .nav-links a[href="login.php"] { display: none !important; }
header .nav-links a[href="messages.php"],
header .nav-links a[href="profile.php"] { display: none !important; }

/* Hide hero headline/logo copy on mobile */
.mobile-hidden { display: none !important; }

/* Container tweaks */
.container { padding: 0 6px; }
.main-content { padding-top: 20px; padding-bottom: 24px; }

/* Larger touch targets */
.btn { min-height: 44px; padding: 10px 16px; font-size: 14px; }
.icon-btn { width: 44px; height: 44px; }

/* Compact header on mobile */
header { min-height: var(--header-height); }
header .header-container { padding: 6px 8px; gap: 10px; }

/* Add little padding after header on mobile view */
/* REMOVED body padding/margin that caused gap above header */
/* body { padding-top: ... } */

.logo { gap: 6px; }
.mobile-lang-switch { gap: 6px; }
.mobile-lang-switch img { width: 20px; height: 15px; }

/* Global mobile hardening */
html, body { overflow-x: hidden; }
img, video { max-width: 100%; height: auto; }
.hero-section { margin: 0 !important; border-radius: 0 !important; padding: 20px 12px !important; }
.hero-section a[href="post-ad.php"] { display: none !important; }
.gallery-thumbs { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.gallery-thumbs::-webkit-scrollbar { display: none; }
.ad-title-lg { word-break: break-word; }
.price-tag { font-size: 1rem; }
.ad-main-content { overflow: hidden; }
.ad-detail-layout { max-width: 100% !important; }
.lightbox { overscroll-behavior: contain; }
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* Ads listing card tweaks (mobile) */
.ads-grid .ad-card { overflow: hidden; }

/* Mobile placeholders visibility */
input::placeholder,
textarea::placeholder,
.form-control::placeholder {
    color: #9ca3af;
    opacity: 1;
    font-size: 15px;
}
/* Safari */
input::-webkit-input-placeholder,
textarea::-webkit-input-placeholder {
    color: #9ca3af;
    opacity: 1;
}
/* Edge/IE legacy */
input:-ms-input-placeholder,
textarea:-ms-input-placeholder {
    color: #9ca3af;
}

/* Mobile form inputs (Post Ad) */
.form-group { margin-bottom: 14px; }
.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}
.form-control {
    width: 100%;
    padding: 14px 14px;
    font-size: 16px;
    border-radius: 12px;
    border: 1px solid transparent;
    background: #f0f2f5;
    color: #111827;
}
.form-control:focus {
    background: #ffffff;
    border-color: #1c4ac6;
    box-shadow: 0 0 0 3px rgba(28, 74, 198, 0.12);
    outline: none;
}
textarea.form-control {
    min-height: 140px;
    line-height: 1.5;
    resize: vertical;
}

/* Simplify cards (Jiji-style two-column) */
.ads-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.ad-card { border-radius: 10px; box-shadow: none; border: 1px solid #eee; }
.ad-image { object-fit: cover; }
.ad-title { font-size: 12px; line-height: 1.3; }
.ad-price { font-size: 14px; font-weight: 700; line-height: 1.2; }

/* Ad meta layout (mobile) */
.ad-meta { display: flex; flex-direction: column; gap: 2px; font-size: 11px; border-top: none; padding-top: 0; margin-top: 6px; }
.meta-location, .meta-time, .meta-distance { display: flex; align-items: center; width: 100%; color: #666; }
.meta-location i, .meta-time i, .meta-distance i { margin-right: 4px; flex-shrink: 0; color: #999; }
/* Override style.css loc-mobile to ensure it fits */
.loc-mobile { display: inline; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.loc-desktop { display: none !important; }
.ad-location { display: flex; align-items: center; gap: 4px; }
.ad-location i { margin-right: 4px; flex-shrink: 0; color: #999; }

.ad-content { padding: 6px; }

/* Reduce animations */
* { transition: none !important; animation: none !important; }

/* Reels page basic mobile constraints (if visible) */
.reels-container { max-width: 100% !important; }
.reel-actions .action-btn .action-label { font-size: 11px; }

/* Add spacing between header and section titles (Categories / See All) on mobile */
h3 { margin-top: 15px; }

/* Navigation spacing */
.nav-links a { padding: 8px 10px; }

/* Skeleton loader utility */
.skeleton { background: #eee; border-radius: 8px; position: relative; overflow: hidden; }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent); animation: shimmer 1.2s infinite; }
@keyframes shimmer { 100% { transform: translateX(100%); } }
