/* Responsive tweaks for Sellora Storefront */

/* =========================================================================
   HEADER – Mobile / Responsive Layout
   ========================================================================= */

/* Base header row */
.main-header-wrapper {
  background: #ffffff;
  border-bottom: 1px solid var(--app-border, #e5e7eb);
  position: sticky;
  top: 0;
  z-index: 1020;
  box-shadow: 0 1px 6px rgba(15,23,42,0.05);
}

.header-main-row {
  min-height: 60px;
  padding-top: 10px;
  padding-bottom: 10px;
  gap: 0;
}

/* Brand column */
.header-brand-col {
  min-width: 0;
}

.brand-logo-img {
  max-height: 36px;
  width: auto;
  display: block;
}

.brand-icon-fallback {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--app-primary, #ff5e14);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.brand-name-text {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--app-navy-dark, #0f172a);
  white-space: nowrap;
}
.brand-name-text span {
  color: var(--app-primary, #ff5e14);
}

/* Mobile menu toggle */
.mobile-menu-toggle {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none !important;
  background: transparent !important;
  color: #1f2937;
  font-size: 1.4rem;
  border-radius: 8px;
  padding: 0;
  flex-shrink: 0;
  transition: background-color 0.2s ease;
}
.mobile-menu-toggle:hover {
  background: #f1f5f9 !important;
  color: var(--app-primary, #ff5e14);
}

/* Search column */
.header-search-col {
  min-width: 0;
}

/* ---- Tablet (≤991px) ---- */
@media (max-width: 991.98px) {
  .header-main-row {
    padding-top: 8px;
    padding-bottom: 8px;
    min-height: 56px;
  }

  .brand-name-text {
    font-size: 1.25rem;
  }

  .header-search-col {
    padding-left: 8px !important;
    padding-right: 8px !important;
  }

  .header-search-bar-clean {
    padding: 2px 6px 2px 10px;
  }

  .search-input-clean {
    font-size: 0.875rem !important;
    padding: 0.35rem 0.2rem !important;
  }
}

/* ---- Mobile (≤767px) ---- */
@media (max-width: 767.98px) {
  .header-main-row {
    padding-top: 8px;
    padding-bottom: 8px;
    min-height: 52px;
  }

  .brand-name-text {
    font-size: 1.15rem;
  }

  /* Hide logo text on very small screens, keep icon */
  .brand-logo-img {
    max-height: 30px;
  }

  .header-search-col {
    padding-left: 6px !important;
    padding-right: 4px !important;
  }

  .header-search-bar-clean {
    border-radius: 8px;
    padding: 3px 6px 3px 10px;
  }

  .search-input-clean {
    font-size: 0.84rem !important;
    padding: 0.3rem 0.15rem !important;
  }

  .search-input-clean::placeholder {
    font-size: 0.82rem;
  }
}

/* ---- Small Mobile (≤575px) ---- */
@media (max-width: 575.98px) {
  .main-header-wrapper {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
  }

  .header-main-row {
    padding-top: 7px;
    padding-bottom: 7px;
    min-height: 50px;
  }

  .brand-name-text {
    display: none; /* icon only on very small screens */
  }

  .brand-logo-img {
    max-height: 28px;
  }

  .header-search-col {
    padding-left: 6px !important;
    padding-right: 4px !important;
  }

  .header-search-bar-clean {
    padding: 2px 4px 2px 8px;
  }

  .search-input-clean::placeholder {
    content: 'Search...';
  }
}

/* ---- Very Small (≤380px) ---- */
@media (max-width: 380px) {
  .mobile-menu-toggle {
    width: 30px;
    height: 30px;
    font-size: 1.2rem;
  }

  .brand-icon-fallback {
    width: 30px;
    height: 30px;
    font-size: 1rem;
    border-radius: 8px;
  }

  .header-icon-action-btn {
    width: 32px !important;
    height: 32px !important;
    font-size: 1.15rem !important;
  }
}
@media (max-width: 1199.98px) {
  .container-storefront {
    padding-left: 16px;
    padding-right: 16px;
  }
}

@media (max-width: 991.98px) {
  .hero-slider-card {
    min-height: 320px;
    padding: 2rem 1.5rem;
  }
  .hero-title {
    font-size: 1.85rem;
  }
  .side-promo-card {
    min-height: 160px;
  }
  .header-search-bar .category-select {
    display: none;
  }
  .deals-week-container {
    padding: 1.5rem 1.25rem;
  }
  .wide-hero-promo-banner {
    padding: 2rem 1.5rem;
  }
  .wide-hero-promo-banner h2 {
    font-size: 1.75rem;
  }
  .shop-header-banner {
    padding: 1.5rem 1.25rem !important;
  }
  .vendor-hero-card {
    padding: 1.5rem 1.25rem !important;
  }
  .vendor-tabs-nav {
    overflow-x: auto;
    flex-wrap: nowrap;
    white-space: nowrap;
    padding-bottom: 4px;
  }
  .group-buy-banner-header {
    padding: 1.5rem 1.25rem !important;
  }
  .checkout-summary-sticky {
    position: static !important;
    margin-top: 1.5rem;
  }
}

@media (max-width: 767.98px) {
  .brand-logo-text {
    font-size: 1.4rem;
  }
  .features-strip-wrapper .feature-item-box {
    border-bottom: 1px solid #f1f5f9;
    padding: 0.75rem 0.5rem;
  }
  .hero-title {
    font-size: 1.5rem;
  }
  .product-thumb-box {
    min-height: 150px;
  }
  .product-thumb-box img {
    max-height: 120px;
  }
  
  /* Cart Table Polish for Mobile */
  .cart-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .cart-table {
    min-width: 580px;
  }

  /* Product List Cards Stack */
  .product-list-card .row {
    row-gap: 1rem;
  }
  .product-list-card .border-start-md {
    border-left: none;
    border-top: 1px solid #f1f5f9;
    padding-top: 1rem;
  }

  /* Group Buy Card Grid */
  .group-buy-card {
    margin-bottom: 1rem;
  }

  /* =========================================================================
     Mobile Tabs: Icon-only for Inactive, Title + Icon for Active
     ========================================================================= */
  .custom-product-tabs,
  .vendor-tabs-nav {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 0.4rem !important;
    padding-bottom: 0.5rem !important;
  }
  .custom-product-tabs::-webkit-scrollbar,
  .vendor-tabs-nav::-webkit-scrollbar {
    display: none;
  }
  .custom-product-tabs .nav-item,
  .vendor-tabs-nav .nav-item {
    flex-shrink: 0;
  }
  .custom-product-tabs .nav-link,
  .vendor-tabs-nav .nav-link {
    font-size: 0.825rem !important;
    border-radius: 50px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
    white-space: nowrap !important;
  }
  
  /* Inactive tab: Icon only with compact circular/pill shape */
  .custom-product-tabs .nav-link:not(.active),
  .vendor-tabs-nav .nav-link:not(.active) {
    background: #f1f5f9 !important;
    color: #64748b !important;
    border: 1px solid #e2e8f0 !important;
    min-width: 42px !important;
    height: 42px !important;
    padding: 0 0.75rem !important;
  }
  .custom-product-tabs .nav-link:not(.active) .tab-title,
  .vendor-tabs-nav .nav-link:not(.active) .tab-title {
    display: none !important;
  }
  .custom-product-tabs .nav-link:not(.active) i,
  .custom-product-tabs .nav-link:not(.active) .tab-icon,
  .vendor-tabs-nav .nav-link:not(.active) i,
  .vendor-tabs-nav .nav-link:not(.active) .tab-icon {
    font-size: 1.15rem !important;
    margin: 0 !important;
  }

  /* Active tab: Full title + icon with glowing active pill */
  .custom-product-tabs .nav-link.active,
  .vendor-tabs-nav .nav-link.active {
    background: #0f172a !important;
    color: #ffffff !important;
    border: 1px solid #0f172a !important;
    height: 42px !important;
    padding: 0 1.15rem !important;
    gap: 0.45rem !important;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.22) !important;
  }
  .custom-product-tabs .nav-link.active .tab-title,
  .vendor-tabs-nav .nav-link.active .tab-title {
    display: inline-block !important;
    font-weight: 700 !important;
    font-size: 0.825rem !important;
  }
  .custom-product-tabs .nav-link.active i,
  .custom-product-tabs .nav-link.active .tab-icon,
  .vendor-tabs-nav .nav-link.active i,
  .vendor-tabs-nav .nav-link.active .tab-icon {
    font-size: 1.1rem !important;
    color: #ffffff !important;
  }
}

/* Mobile Screens */
@media (max-width: 576px) {
  .container-storefront {
    padding-left: 12px;
    padding-right: 12px;
  }
  .sticky-product-buy-bar {
    padding: 0.4rem 0.5rem !important;
  }
  .sticky-product-buy-bar .container-storefront {
    padding-left: 0.25rem !important;
    padding-right: 0.25rem !important;
  }
  .sticky-buy-thumb {
    width: 36px !important;
    height: 36px !important;
  }
  .sticky-buy-title {
    max-width: 140px !important;
    font-size: 0.78rem !important;
    line-height: 1.2 !important;
  }
  #stickyDisplayPrice {
    font-size: 0.85rem !important;
    line-height: 1.2 !important;
  }
  #btnStickyAddToCart {
    padding: 0.45rem 0.75rem !important;
    font-size: 0.8rem !important;
    border-radius: 8px !important;
    white-space: nowrap !important;
  }
  #btnStickyAddToCart i {
    font-size: 0.95rem !important;
  }

  /* Vendor Showcase */
  .vendor-showcase-avatar {
    width: 56px !important;
    height: 56px !important;
  }

  /* Nice-select full width on mobile if inside form group or w-100 */
  .form-group .nice-select,
  .w-100.nice-select,
  .checkout-step-card .nice-select {
    width: 100% !important;
  }
}

@media (max-width: 380px) {
  .sticky-buy-title {
    max-width: 95px !important;
    font-size: 0.72rem !important;
  }
  #stickyDisplayPrice {
    font-size: 0.78rem !important;
  }
  #btnStickyAddToCart {
    padding: 0.38rem 0.55rem !important;
    font-size: 0.75rem !important;
  }
}

/* =========================================================================
   Mobile Bottom Sticky Navigation Bar
   ========================================================================= */
@media (max-width: 991.98px) {
  body {
    padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)) !important;
  }

  .mobile-bottom-navigation {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1040;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid rgba(226, 232, 240, 0.85);
    box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.07);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  .mobile-bottom-nav-container {
    display: flex;
    align-items: center;
    justify-content: space-around;
    height: 60px;
    max-width: 540px;
    margin: 0 auto;
    padding: 0 0.5rem;
  }

  .mobile-bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #64748b;
    background: transparent;
    border: none;
    outline: none;
    padding: 4px 2px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    cursor: pointer;
  }

  .mobile-bottom-nav-item .nav-item-icon-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 28px;
    margin-bottom: 2px;
    transition: transform 0.2s ease;
  }

  .mobile-bottom-nav-item .nav-item-icon-wrap i {
    font-size: 1.35rem;
    line-height: 1;
    color: inherit;
    transition: color 0.2s ease;
  }

  .mobile-bottom-nav-item .nav-item-label {
    font-size: 0.68rem;
    font-weight: 500;
    line-height: 1.1;
    color: inherit;
    letter-spacing: 0.01em;
    white-space: nowrap;
  }

  .mobile-bottom-nav-item .mobile-nav-badge {
    position: absolute;
    top: -4px;
    right: -6px;
    font-size: 0.6rem;
    font-weight: 700;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.12);
  }

  /* Active & Hover States */
  .mobile-bottom-nav-item:hover,
  .mobile-bottom-nav-item.active {
    color: var(--primary-color, #ff5e14) !important;
  }

  .mobile-bottom-nav-item.active .nav-item-label {
    font-weight: 700;
    color: var(--primary-color, #ff5e14);
  }

  .mobile-bottom-nav-item.active .nav-item-icon-wrap {
    transform: translateY(-2px);
  }

  .mobile-bottom-nav-item.active .nav-item-icon-wrap i {
    color: var(--primary-color, #ff5e14);
  }
}

