/* =====================================================================
   Mobile & Tablet Responsive Styling - IndiaSkokka
   Full Mobile-First Experience across Website and Admin Console
   ===================================================================== */

/* ---------------------------------------------------------------------
   1. Universal Mobile Reset & Viewport Constraints
   --------------------------------------------------------------------- */
html, body {
  overflow-x: clip;
  max-width: 100%;
  width: 100%;
}

@media (max-width: 767.98px) {
  body {
    padding-bottom: 68px; /* Space for the Mobile Bottom Navigation Bar */
  }

  body.has-mobile-bottom-bar {
    padding-bottom: 84px; /* Space for Detail Page Call/WhatsApp Bar */
  }

  body.has-mobile-bottom-bar .app-bottom-nav,
  body.is-publish-page .app-bottom-nav,
  body.is-checkout-page .app-bottom-nav {
    display: none !important; /* Hide bottom nav when dedicated action bar or publish flow is active */
  }

  body.is-publish-page,
  body.is-checkout-page {
    padding-bottom: 24px !important;
  }

  .container, .container-fluid {
    padding-left: 12px;
    padding-right: 12px;
  }

  /* Smooth horizontal scrolling for breadcrumbs on small devices */
  .breadcrumb {
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
  }
  .breadcrumb::-webkit-scrollbar {
    display: none;
  }
  .breadcrumb-item {
    white-space: nowrap !important;
  }
}

/* ---------------------------------------------------------------------
   2. Responsive Header Navigation (Zero Overflow Guarantee)
   --------------------------------------------------------------------- */
.site-header {
  width: 100%;
  overflow: visible !important;
  background: #ffffff;
  border-bottom: 1px solid var(--color-border);
}

@media (max-width: 767.98px) {
  .site-header .container {
    padding-left: 10px;
    padding-right: 10px;
  }

  .site-header .brand-logo {
    font-size: 1.25rem !important;
    letter-spacing: -0.5px;
  }

  .city-select-btn {
    padding: 5px 9px !important;
    font-size: 0.8rem !important;
    gap: 4px !important;
    background: #f1f5f9;
    border-radius: 20px;
  }

  .city-select-label {
    max-width: 80px !important;
    display: inline-block;
  }

  .header-action-btn {
    width: 32px !important;
    height: 32px !important;
    padding: 0 !important;
    font-size: 0.85rem !important;
    border-color: #cbd5e1 !important;
  }

  .btn-publish-ad-mobile {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #38bdf8 0%, #0284c7 100%);
    color: #ffffff !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(2, 132, 199, 0.35);
  }
}

@media (max-width: 380px) {
  .site-header .brand-logo {
    font-size: 1.15rem !important;
  }

  .city-select-label {
    max-width: 65px !important;
  }

  .city-select-btn {
    padding: 4px 7px !important;
    font-size: 0.75rem !important;
  }
}

/* ---------------------------------------------------------------------
   3. Category Strip (Horizontal Touch Swipe)
   --------------------------------------------------------------------- */
.category-nav-bar {
  padding: 6px 0;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.category-nav-bar::-webkit-scrollbar {
  display: none;
}

.category-nav-bar .container {
  display: flex !important;
  flex-wrap: nowrap !important;
  overflow-x: auto !important;
  scrollbar-width: none;
  padding-left: 10px;
  padding-right: 10px;
}

.category-nav-bar .container::-webkit-scrollbar {
  display: none;
}

.cat-chip {
  padding: 6px 13px !important;
  font-size: 0.8rem !important;
  gap: 5px !important;
  margin-right: 6px !important;
  flex-shrink: 0 !important;
}

/* ---------------------------------------------------------------------
   4. Native App-Style Mobile Bottom Navigation Bar
   --------------------------------------------------------------------- */
.app-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
  z-index: 1030;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08);
}

.app-bottom-nav-inner {
  height: 100%;
  max-width: 600px;
  margin: 0 auto;
  padding: 0 4px;
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #64748b;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 4px 6px;
  line-height: 1.2;
  transition: color 0.15s ease;
  cursor: pointer;
}

.bottom-nav-item i {
  font-size: 1.22rem;
  line-height: 1;
  margin-bottom: 2px;
}

.bottom-nav-item:hover, 
.bottom-nav-item.active {
  color: var(--color-primary);
}

.bottom-nav-post-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 0 4px;
  text-decoration: none;
}

.post-cta-bubble {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #38bdf8 0%, #0284c7 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: -22px;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.4);
  border: 3px solid #ffffff;
  font-size: 1.25rem;
  font-weight: 900;
  transition: transform 0.15s ease;
}

.bottom-nav-post-cta:active .post-cta-bubble {
  transform: scale(0.92);
}

.bottom-nav-post-cta span {
  font-size: 0.65rem;
  font-weight: 800;
  color: #0284c7;
  margin-top: 2px;
  letter-spacing: 0.3px;
}

/* ---------------------------------------------------------------------
   5. Detail Page Fixed Bottom Action Bar (Call & WhatsApp)
   --------------------------------------------------------------------- */
.mobile-bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid rgba(2, 132, 199, 0.2);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 1050;
  box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.12);
}

.mobile-bottom-bar .btn-whatsapp-lg,
.mobile-bottom-bar .btn-call-lg {
  margin-bottom: 0;
  padding: 11px;
  font-size: 0.95rem;
  border-radius: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

@media (max-width: 991.98px) {
  .gallery-main-view.premium-main-view {
    height: 380px;
  }
  
  .specs-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 575.98px) {
  .gallery-main-view.premium-main-view {
    height: 310px;
  }
  
  .ad-detail-header.premium-detail-header {
    padding: 16px;
  }
  
  .specs-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .gallery-nav-btn {
    width: 36px;
    height: 36px;
    font-size: 1.05rem;
  }
  
  .gallery-thumbs-row.premium-thumbs .gallery-thumb {
    width: 68px;
    height: 52px;
  }
}

/* ---------------------------------------------------------------------
   6. Hero & Homepage Responsiveness
   --------------------------------------------------------------------- */
@media (max-width: 767.98px) {
  .hero-search-section {
    padding: 24px 0 16px 0;
  }

  .skokka-hero {
    padding: 42px 14px 48px !important;
  }

  .skokka-hero-title {
    font-size: 1.85rem !important;
    margin-bottom: 16px !important;
  }

  .skokka-hero-search {
    padding: 4px 8px 4px 16px !important;
  }

  .hero-search-section h1 {
    font-size: 1.4rem !important;
  }

  .hero-search-card {
    padding: 12px;
    border-radius: 12px;
  }

  .hero-search-card .row > div {
    margin-bottom: 6px;
  }

  .state-nav-pills {
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 4px;
  }

  .state-nav-pills::-webkit-scrollbar {
    display: none;
  }

  .state-nav-pills .nav-link {
    white-space: nowrap !important;
    font-size: 0.8rem !important;
    padding: 6px 14px !important;
  }
}

/* ---------------------------------------------------------------------
   7. Classified Advertisement Card (Mobile Optimization)
   --------------------------------------------------------------------- */
@media (max-width: 575.98px) {
  .listing-card, .sk-card, .ad-card {
    min-height: auto !important;
    margin-bottom: 8px;
    border-radius: 12px !important;
  }

  .listing-card-body {
    padding: 12px 14px !important;
  }

  .listing-card-title {
    font-size: 0.98rem !important;
    line-height: 1.35 !important;
    margin-bottom: 6px !important;
  }

  .listing-card-price {
    font-size: 1.05rem !important;
    margin-bottom: 6px !important;
  }

  .listing-card-snippet {
    font-size: 0.82rem !important;
    margin-bottom: 10px !important;
    line-height: 1.4 !important;
  }

  .listing-card-footer {
    flex-wrap: nowrap;
    gap: 6px;
    padding-top: 8px !important;
  }
  .listing-card-time {
    white-space: nowrap !important;
    font-size: 0.74rem !important;
    flex-shrink: 0;
  }
}

/* ---------------------------------------------------------------------
   8. Post Free Ad & Edit Ad Forms on Mobile
   --------------------------------------------------------------------- */
@media (max-width: 767.98px) {
  .publish-card, .publish-container {
    padding: 0 2px !important;
    margin-top: 6px;
  }

  .publish-mode-selector {
    max-width: 100% !important;
    padding: 3px !important;
    gap: 3px !important;
    border-radius: 9999px !important;
  }

  .publish-mode-btn {
    flex: 1 1 50% !important;
    min-width: 0 !important;
    font-size: 0.80rem !important;
    padding: 7px 6px !important;
    gap: 4px !important;
    border-radius: 9999px !important;
  }

  .form-section-card {
    padding: 16px 14px !important;
    margin-bottom: 16px !important;
    border-radius: 12px !important;
  }

  .form-section-header {
    margin-bottom: 12px !important;
  }

  .form-section-title {
    font-size: 1.05rem !important;
  }

  .pills-group {
    gap: 6px !important;
    margin-top: 4px !important;
    margin-bottom: 12px !important;
  }

  .pill-option .pill-label {
    padding: 6px 12px !important;
    font-size: 0.82rem !important;
  }

  .contact-pref-row {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }

  .contact-pref-card {
    padding: 10px 8px !important;
    font-size: 0.82rem !important;
    border-radius: 8px !important;
  }

  .photo-gallery-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }

  .publish-plan-card {
    padding: 14px !important;
    border-radius: 12px !important;
  }

  .turnstile-box {
    width: 100% !important;
    padding: 10px 12px !important;
    gap: 10px !important;
  }

  .publish-card .card {
    padding: 14px 12px !important;
    margin-bottom: 14px !important;
    border-radius: 12px !important;
  }

  .publish-card h1 {
    font-size: 1.35rem !important;
  }

  .publish-card h2 {
    font-size: 1.1rem !important;
  }

  /* Prevent automatic iOS input zoom */
  .form-control, .form-select {
    font-size: 16px !important;
    padding: 10px 12px !important;
    border-radius: 8px !important;
  }
}

@media (max-width: 420px) {
  .publish-mode-btn {
    font-size: 0.72rem !important;
    padding: 6px 3px !important;
    gap: 2px !important;
  }

  .form-section-card {
    padding: 14px 10px !important;
  }

  .pill-option .pill-label {
    padding: 5px 9px !important;
    font-size: 0.77rem !important;
  }

  .contact-pref-card {
    font-size: 0.76rem !important;
    padding: 8px 4px !important;
  }
}

/* ---------------------------------------------------------------------
   9. Ad Detail Page Gallery & Layout
   --------------------------------------------------------------------- */
@media (max-width: 991.98px) {
  .gallery-main-view {
    height: 320px;
  }

  .contact-card-sticky {
    position: static;
    margin-top: 20px;
  }
}

@media (max-width: 767.98px) {
  .gallery-main-view {
    height: 260px;
    border-radius: 12px;
  }

  .gallery-thumbs-strip {
    gap: 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .gallery-thumb-item {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
  }

  .ad-detail-header h1 {
    font-size: 1.3rem !important;
  }
}

/* ---------------------------------------------------------------------
   10. Admin Console Mobile Responsiveness
   --------------------------------------------------------------------- */
@media (max-width: 991.98px) {
  .admin-sidebar {
    min-height: auto;
    padding-top: 0 !important;
  }
}

@media (max-width: 767.98px) {
  .admin-sidebar {
    min-height: auto;
    padding-top: 0 !important;
  }

  .table-responsive {
    -webkit-overflow-scrolling: touch;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    margin-bottom: 16px;
    background: #ffffff;
  }

  .table-responsive table {
    min-width: 620px; /* Allows horizontal touch swipe without squishing table columns */
  }

  .table th, .table td {
    padding: 10px 12px;
    white-space: nowrap;
  }

  .admin-stat-card {
    margin-bottom: 12px;
  }
}

/* ---------------------------------------------------------------------
   11. Cookie Banner Mobile Responsive
   --------------------------------------------------------------------- */
@media (max-width: 767.98px) {
  .cookie-banner {
    flex-direction: column;
    text-align: center;
    bottom: 68px; /* Appears above the mobile bottom nav */
    left: 10px;
    right: 10px;
    padding: 14px 16px;
    border-radius: 12px;
  }

  .cookie-banner .btn {
    width: 100%;
  }
}

/* ---------------------------------------------------------------------
   12. Location Modal & Dialog Mobile Optimizations
   --------------------------------------------------------------------- */
#locationSelectModal .modal-header {
  background: #0f172a !important;
  color: #ffffff !important;
}

#locationSelectModal .modal-header .modal-title,
#locationSelectModal .modal-header h5 {
  color: #ffffff !important;
}

@media (max-width: 575.98px) {
  #locationSelectModal .modal-dialog {
    margin: 8px auto !important;
    max-width: calc(100% - 16px) !important;
    width: 100% !important;
  }

  #locationSelectModal .modal-content {
    border-radius: 16px !important;
    max-height: 92vh !important;
  }

  .modal-mobile-state-strip {
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .modal-mobile-state-strip::-webkit-scrollbar {
    display: none;
  }

  .modal-state-mobile-btn {
    font-size: 0.78rem !important;
    padding: 5px 12px !important;
  }

  .location-city-tile {
    padding: 8px 6px !important;
    border-radius: 8px !important;
  }

  .location-city-tile .small {
    font-size: 0.82rem !important;
  }
}

/* ---------------------------------------------------------------------
   13. Global Mobile Polish: Dashboard, Profile & Checkout
   --------------------------------------------------------------------- */
@media (max-width: 767.98px) {
  /* Dashboard Promotional Spooky Banner */
  .dashboard-spooky-banner {
    padding: 14px 16px !important;
    border-radius: 14px !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 12px !important;
  }

  .dashboard-spooky-banner .banner-btn {
    padding: 6px 14px !important;
    font-size: 0.82rem !important;
  }

  .countdown-badge {
    font-size: 0.82rem !important;
    padding: 5px 12px !important;
  }

  /* User Profile Header Card */
  .profile-hero-card,
  .user-profile-widget {
    border-radius: 14px !important;
    padding: 16px 14px !important;
  }

  /* Checkout Order Summary Card */
  .position-sticky {
    position: static !important;
  }

  /* Universal Buttons and Badges on Mobile */
  .btn-lg {
    font-size: 1rem !important;
    padding: 12px 18px !important;
  }
}

@media (max-width: 575.98px) {
  /* Profile page buttons */
  .profile-hero-actions .btn {
    flex: 1 1 calc(50% - 6px);
    justify-content: center;
    font-size: 0.82rem !important;
    padding: 8px 10px !important;
  }
}

