/* ============================================================
   store-mobile.css — Phase 1 mobile polish for the store page
   Loaded only by templates/store/store.html
   Scope: mobile (≤991px). Desktop store page unaffected.
   ============================================================ */

/* ====== 1. Trim chrome on the store page (mobile only) ====== */
@media (max-width: 991px) {

  /* Hide signup marquee banner on the store page */
  #signupMarqueeBanner {
    display: none !important;
  }

  /* Hide breadcrumb on the store page */
  .store-page nav[aria-label="breadcrumb"],
  .store-page .breadcrumb {
    display: none !important;
  }

  /* Pull product grid up to fill the space the breadcrumb vacated */
  .store-page .section-content,
  section.section-content.store-page {
    padding-top: 8px !important;
  }
}

/* ====== 2. Mobile header polish (≤991px) ====== */
@media (max-width: 991px) {

  /* Replace translucent blur with solid white for crisper text */
  .ps-mobile-header {
    background: rgba(255, 255, 255, 0.98) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06) !important;
  }

  /* Shrink logo from 36px → 30px */
  .ps-logo-container img,
  .ps-logo-container img.ps-logo {
    height: 30px !important;
  }
}

/* ====== 3. Product card mobile redesign (≤767px) ====== */
@media (max-width: 767px) {

  /* Softer card surface */
  .store-page .feature-item-card .card {
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
  }
  .store-page .feature-item-card .card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  }

  /* Image: 260 → 220px on mobile (overrides inline height: 260px) */
  .store-page .feature-item-card .card .img-wrap {
    height: 220px;
  }
  .store-page .feature-item-card .card .img-wrap img {
    height: 220px !important;
  }

  /* Title: 16/500 → 13/500, sharper neutral */
  .store-page .feature-item-card .card .info-wrap .title {
    font-size: 13px;
    font-weight: 500;
    color: #222;
    line-height: 1.35;
    margin-bottom: 6px;
  }

  /* Info padding tighter */
  .store-page .feature-item-card .card .info-wrap {
    padding: 10px 12px 12px;
  }

  /* Price block compact + clear */
  .store-page .feature-item-card .card .info-wrap .price {
    font-size: 15px;
    font-weight: 700;
    color: #1A1A1A;
  }
  .store-page .feature-item-card .card .info-wrap .price-old {
    font-size: 12px;
    margin-left: 6px;
  }

  /* Smaller wishlist heart (38 → 32) */
  .store-page .feature-item-card .card .favourite-tag {
    width: 32px;
    height: 32px;
    line-height: 32px;
    top: 8px;
    right: 8px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  }
  .store-page .feature-item-card .card .favourite-tag i {
    font-size: 1.05rem;
  }
}

/* ====== 4. Phase 2: Sticky mobile toolbar (pills + chips) ====== */
@media (max-width: 991px) {

  /* Hide floating filter FAB — replaced by toolbar */
  .filter-fab-container {
    display: none !important;
  }

  /* Hide the original (desktop) chip strip on mobile — chips are mirrored into the toolbar */
  .store-page #selected-categories {
    display: none !important;
  }

  /* Toolbar container: sticky under the 52px mobile header */
  .store-toolbar {
    position: sticky;
    top: 52px;
    z-index: 900;
    background: #FFFFFF;
    border-bottom: 1px solid #EEEEEE;
    margin: 0 -4px 8px;            /* bleed to viewport edges; counter the col padding */
    padding: 0;
  }

  /* Row 1: title + product count */
  .store-toolbar-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px 6px;
    min-height: 36px;
  }
  .store-toolbar-title {
    font-size: 15px;
    font-weight: 600;
    color: #1A1A1A;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-transform: capitalize;
  }
  .store-toolbar-count {
    font-size: 12px;
    font-weight: 500;
    color: #666;
    flex-shrink: 0;
  }
  .store-toolbar-count:empty {
    display: none;
  }

  /* Row 2: horizontally scrollable pills + chips */
  .store-toolbar-pills {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px 10px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-padding-left: 12px;
    -webkit-overflow-scrolling: touch;
  }
  .store-toolbar-pills::-webkit-scrollbar {
    display: none;
  }

  /* Pill button */
  .store-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    height: 34px;
    padding: 0 12px;
    border: 1px solid #D8D8D8;
    border-radius: 17px;
    background: #FFFFFF;
    color: #1A1A1A;
    font-size: 13px;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
    white-space: nowrap;
  }
  .store-pill:active {
    transform: scale(0.97);
    background: #F5F5F5;
  }
  .store-pill i {
    font-size: 12px;
    color: #666;
  }
  .store-pill .store-pill-chev {
    font-size: 10px;
    margin-left: 2px;
  }

  /* Filter pill — primary visual weight (terracotta accent) */
  .store-pill.store-pill-primary {
    border-color: #996633;
    color: #996633;
    background: rgba(153, 102, 51, 0.04);
  }
  .store-pill.store-pill-primary i {
    color: #996633;
  }

  /* Filter pill badge — sage when filters are applied */
  .store-pill-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    margin-left: 2px;
    border-radius: 9px;
    background: #AFBD77;
    color: #FFFFFF;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
  }

  /* Inline chip strip area inside the same scroll row */
  .store-toolbar-chips {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
  }
  .store-toolbar-chips:not(:empty)::before {
    content: "";
    display: inline-block;
    width: 1px;
    height: 22px;
    background: #E5E5E5;
    margin: 0 4px;
  }

  /* Restyle the JS-injected chips inside the toolbar (overrides inline styles set by store.js) */
  .store-toolbar-chips ul,
  .store-toolbar-chips .selected-item {
    list-style: none;
    margin: 0;
    padding: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
  }
  .store-toolbar-chips .selected-item > div {
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    height: 30px !important;
    padding: 0 6px 0 10px !important;
    margin: 0 !important;
    background: #F4EFE7 !important;
    border: 1px solid #D9C9B2 !important;
    border-radius: 15px !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    color: #6E4A1F !important;
    white-space: nowrap !important;
  }
  .store-toolbar-chips .selected-item > div > span {
    line-height: 1 !important;
  }
  .store-toolbar-chips .selected-item > div > button {
    border: none !important;
    background: transparent !important;
    color: #996633 !important;
    cursor: pointer !important;
    font-size: 16px !important;
    line-height: 1 !important;
    padding: 0 4px !important;
    margin: 0 !important;
  }
  .store-toolbar-chips .selected-item > div > button:hover {
    color: #6E4A1F !important;
  }
}

/* ====== 5. Phase 2.5: Chip-style options inside the bottom sheet ====== */
/* Scoped under .bottom-sheet to win over generic .filter-option styles in the
   inline <style> block of store.html (which has lower specificity). The
   selected state uses a JS-toggled .is-checked class — no :has() dependency,
   so it works on every browser that loads this stylesheet. */
@media (max-width: 991px) {

  /* Bigger drop-down area so chips have room to wrap */
  .bottom-sheet #fg-categories .filter-group-content,
  .bottom-sheet #fg-product-type .filter-group-content,
  .bottom-sheet #fg-brand .filter-group-content {
    max-height: 360px !important;
    padding-bottom: 4px;
  }

  /* Container: wrap chips horizontally instead of one per line */
  .bottom-sheet #fg-categories .filter-options,
  .bottom-sheet #fg-product-type .filter-options,
  .bottom-sheet #fg-brand .filter-options {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    padding: 12px 16px 16px !important;
  }

  /* Each option strips its row layout and just hosts a chip */
  .bottom-sheet #fg-categories .filter-option,
  .bottom-sheet #fg-product-type .filter-option,
  .bottom-sheet #fg-brand .filter-option {
    display: inline-flex !important;
    align-items: center !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    cursor: pointer !important;
    transition: none !important;
  }

  /* Native checkbox hidden but still controls state */
  .bottom-sheet #fg-categories .filter-option input[type="checkbox"],
  .bottom-sheet #fg-product-type .filter-option input[type="checkbox"],
  .bottom-sheet #fg-brand .filter-option input[type="checkbox"] {
    position: absolute !important;
    opacity: 0 !important;
    width: 1px !important;
    height: 1px !important;
    margin: 0 !important;
    pointer-events: none !important;
  }

  /* The visible chip — built from the existing <span> */
  .bottom-sheet #fg-categories .filter-option > span,
  .bottom-sheet #fg-product-type .filter-option > span,
  .bottom-sheet #fg-brand .filter-option > span {
    display: inline-flex !important;
    align-items: center !important;
    height: 36px !important;
    padding: 0 14px !important;
    border: 1px solid #D8D8D8 !important;
    border-radius: 18px !important;
    background: #FFFFFF !important;
    color: #333 !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.1s ease !important;
    user-select: none !important;
  }

  .bottom-sheet #fg-categories .filter-option:active > span,
  .bottom-sheet #fg-product-type .filter-option:active > span,
  .bottom-sheet #fg-brand .filter-option:active > span {
    transform: scale(0.97) !important;
    background: #F5F5F5 !important;
  }

  /* Selected state — sage accent, driven by JS-toggled .is-checked class */
  .bottom-sheet #fg-categories .filter-option.is-checked > span,
  .bottom-sheet #fg-product-type .filter-option.is-checked > span,
  .bottom-sheet #fg-brand .filter-option.is-checked > span {
    background: rgba(175, 189, 119, 0.18) !important;
    border-color: #AFBD77 !important;
    color: #4F5D29 !important;
    font-weight: 600 !important;
  }

  /* Add a subtle ✓ on selected chips */
  .bottom-sheet #fg-categories .filter-option.is-checked > span::before,
  .bottom-sheet #fg-product-type .filter-option.is-checked > span::before,
  .bottom-sheet #fg-brand .filter-option.is-checked > span::before {
    content: "\2713";
    margin-right: 6px;
    font-weight: 700;
    color: #6F8A2E;
  }

  /* ===== Price chip grid (replaces Min/Max selects on mobile) ===== */
  /* Hide the original Min/Max select layout; chips replace it visually */
  #fg-price .price-range-inputs {
    display: none !important;
  }

  #fg-price .price-chip-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 14px 16px 18px;
  }

  .price-chip {
    display: inline-flex;
    align-items: center;
    height: 36px;
    padding: 0 14px;
    border: 1px solid #D8D8D8;
    border-radius: 18px;
    background: #FFFFFF;
    color: #333;
    font-size: 13px;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
    white-space: nowrap;
  }
  .price-chip:active {
    transform: scale(0.97);
    background: #F5F5F5;
  }
  .price-chip.active {
    background: rgba(175, 189, 119, 0.14);
    border-color: #AFBD77;
    color: #4F5D29;
    font-weight: 600;
  }
  .price-chip.active::before {
    content: "\2713";
    margin-right: 6px;
    font-weight: 700;
    color: #6F8A2E;
  }
}

/* ====== 6. Phase 2.6: Density pass — Myntra-tight cards + header ====== */

/* Header — crop the "The Nature Products" tagline baked into the logo PNG.
   The image is 2044x634 (3.22:1). Showing image at 30px height = 96.6px wide;
   container is 22px tall with overflow hidden, so the bottom ~27% of the image
   (the tagline) is clipped off. The wordmark fits cleanly in the top 22px. */
@media (max-width: 991px) {
  .ps-logo-container {
    overflow: hidden !important;
    max-height: 22px !important;
    align-items: flex-start !important;
  }
  .ps-logo-container a {
    line-height: 0 !important;
    display: block !important;
  }
  .ps-logo-container img,
  .ps-logo-container img.ps-logo {
    height: 30px !important;
    width: auto !important;
    display: block !important;
    object-fit: unset !important;
  }
  /* Tighter top bar so the visual feels Myntra-thin */
  .ps-top-header {
    padding: 8px 14px !important;
    min-height: 48px !important;
  }
  .ps-icon-btn {
    width: 36px !important;
    height: 36px !important;
  }
  .ps-icon-btn i {
    font-size: 16px !important;
  }
}

/* Sticky toolbar — drop the title/count row entirely on mobile.
   The Shop tab in the bottom nav already signals "you're in the store",
   and any active category is shown as a removable chip in the pill row. */
@media (max-width: 991px) {
  .store-toolbar-title-row {
    display: none !important;
  }
  .store-toolbar-pills {
    padding: 8px 12px !important;
  }
  .store-pill {
    height: 32px !important;
    font-size: 12.5px !important;
    padding: 0 11px !important;
  }
}

/* Product card — Myntra-tight density (phone widths only) */
@media (max-width: 767px) {

  /* Tighter inter-card gap */
  .store-page .feature-item-card {
    padding-left: 3px !important;
    padding-right: 3px !important;
    margin-bottom: 6px !important;
  }

  /* Less puffy card */
  .store-page .feature-item-card .card {
    border-radius: 8px !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
  }

  /* Smaller image — 220 → 180 */
  .store-page .feature-item-card .card .img-wrap {
    height: 180px !important;
  }
  .store-page .feature-item-card .card .img-wrap img {
    height: 180px !important;
  }

  /* Tighter text area */
  .store-page .feature-item-card .card .info-wrap {
    padding: 8px 10px 10px !important;
  }

  /* Title — 13 → 12, denser line height */
  .store-page .feature-item-card .card .info-wrap .title {
    font-size: 12px !important;
    font-weight: 500 !important;
    line-height: 1.3 !important;
    color: #2A2A2A !important;
    margin-bottom: 4px !important;
  }

  /* Price line — compact, with discount chip room */
  .store-page .feature-item-card .card .info-wrap .price-wrap {
    display: flex !important;
    align-items: baseline !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
    font-size: 13px !important;
  }
  .store-page .feature-item-card .card .info-wrap .price {
    font-size: 14px !important;
    font-weight: 700 !important;
    color: #1A1A1A !important;
    margin-right: 0 !important;
  }
  .store-page .feature-item-card .card .info-wrap .price-old {
    font-size: 11px !important;
    font-weight: 400 !important;
    color: #999 !important;
    margin-left: 0 !important;
    text-decoration: line-through;
  }

  /* Discount % chip — sage, inline with price */
  .store-page .feature-item-card .card .discount-pct {
    display: inline-flex;
    align-items: center;
    height: 18px;
    padding: 0 6px;
    border-radius: 4px;
    background: rgba(175, 189, 119, 0.18);
    color: #4F5D29;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.2px;
    line-height: 1;
    white-space: nowrap;
  }

  /* Smaller wishlist heart — 32 → 28 */
  .store-page .feature-item-card .card .favourite-tag {
    width: 28px !important;
    height: 28px !important;
    line-height: 28px !important;
    top: 6px !important;
    right: 6px !important;
  }
  .store-page .feature-item-card .card .favourite-tag i {
    font-size: 0.92rem !important;
  }
}


