/* =============================================
   SHOP LAYOUT  (shop.css)
   Two-column: sidebar left, products right
============================================= */

:root {
    --accent:    #7c3aed;
    --accent-lt: #ede9fe;
    --dark:      #111827;
    --mid:       #6b7280;
    --border:    #e5e7eb;
    --card-bg:   #ffffff;
    --bg:        #f9fafb;
    --radius:    10px;
    --shadow:    0 2px 12px rgba(0,0,0,.08);
  }
  
  *, *::before, *::after { box-sizing: border-box; }
  
  body {
    background: var(--bg);
    color: var(--dark);
    font-family: 'Segoe UI', system-ui, sans-serif;
    margin: 0;
  }
  
  /* ── WRAPPER ── */
  .shop-wrapper {
    display: flex;
    gap: 24px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px 20px 48px;
    align-items: flex-start;
  }
  
  /* =============================================
     LEFT SIDEBAR
  ============================================= */
  .shop-sidebar {
    width: 230px;
    flex-shrink: 0;
    position: sticky;
    top: 106px;          /* below fixed header (60px top + 38px strip + 8px gap) */
    display: flex;
    flex-direction: column;
    gap: 20px;
  }
  
  /* Search inside sidebar */
  .sidebar-search {
    display: flex;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    background: #fff;
  }
  
  .sidebar-search input {
    flex: 1;
    border: none;
    outline: none;
    padding: 9px 12px;
    font-size: 13px;
    min-width: 0;
  }
  
  .sidebar-search button {
    background: var(--accent);
    border: none;
    color: #fff;
    padding: 0 14px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.15s;
  }
  
  .sidebar-search button:hover { background: #6d28d9; }
  
  /* Section wrapper */
  .sidebar-section {
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 16px;
  }
  
  .sidebar-heading {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: var(--mid);
    margin: 0 0 12px;
  }
  
  /* Category list */
  .cat-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
  }
  
  .cat-list a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 7px;
    color: var(--dark);
    text-decoration: none;
    font-size: 13.5px;
    transition: background 0.12s, color 0.12s;
  }
  
  .cat-list a:hover {
    background: var(--accent-lt);
    color: var(--accent);
  }
  
  .cat-list a.active {
    background: var(--accent);
    color: #fff;
    font-weight: 600;
  }
  
  .cat-list a i {
    font-size: 12px;
    width: 14px;
    text-align: center;
  }
  
  /* Quick links (cart / wishlist) */
  .sidebar-quick {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }
  
  .quick-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--dark);
    font-size: 13.5px;
    font-weight: 600;
    transition: background 0.12s;
  }
  
  .quick-link:hover { background: var(--accent-lt); color: var(--accent); }
  
  .ql-badge {
    margin-left: auto;
    background: var(--accent);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    border-radius: 99px;
    min-width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
  }
  
  /* =============================================
     MAIN CONTENT
  ============================================= */
  .shop-main {
    flex: 1;
    min-width: 0;
  }
  
  /* Top bar */
  .shop-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    gap: 12px;
  }
  
  .shop-topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
  }
  
  .sidebar-toggle {
    display: none; /* shown on mobile */
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    gap: 6px;
    align-items: center;
  }
  
  .results-label {
    font-size: 14px;
    color: var(--mid);
  }
  
  .clear-filters {
    font-size: 13px;
    color: var(--accent);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 600;
  }
  
  .clear-filters:hover { text-decoration: underline; }
  
  /* Empty state */
  .empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--mid);
  }
  
  .empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    display: block;
    opacity: .4;
  }
  
  .empty-state p { font-size: 16px; margin: 0 0 12px; }
  
  .empty-state a {
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
  }
  
  /* =============================================
     PRODUCT GRID
  ============================================= */
  .product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 18px;
  }
  
  /* ── PRODUCT CARD ── */
  .p-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.18s, box-shadow 0.18s;
    display: flex;
    flex-direction: column;
  }
  
  .p-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
  }
  
  /* Image area */
  .p-card-img {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #f3f4f6;
  }
  
  .p-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
  }
  
  .p-card:hover .p-card-img img { transform: scale(1.06); }
  
  /* Stock badge */
  .badge-stock {
    position: absolute;
    top: 8px;
    left: 8px;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 99px;
    text-transform: uppercase;
    letter-spacing: .5px;
  }
  
  .badge-stock.in  { background: #d1fae5; color: #065f46; }
  .badge-stock.low { background: #fef3c7; color: #92400e; }
  .badge-stock.out { background: #fee2e2; color: #991b1b; }
  
  /* Category chip */
  .p-card-cat {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0,0,0,.55);
    color: #fff;
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 99px;
  }
  
  /* Card body */
  .p-card-body {
    padding: 12px 14px 14px;
    display: flex;
    flex-direction: column;
    flex: 1;
  }
  
  .p-card-brand {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .7px;
    color: var(--accent);
    margin: 0 0 4px;
  }
  
  .p-card-title {
    font-size: 14px;
    font-weight: 700;
    margin: 0 0 6px;
    line-height: 1.3;
    color: var(--dark);
  }
  
  .p-card-desc {
    font-size: 12px;
    color: var(--mid);
    margin: 0 0 12px;
    flex: 1;
    line-height: 1.5;
  }
  
  .p-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
  }
  
  .p-card-price {
    font-size: 16px;
    font-weight: 800;
    color: var(--dark);
  }
  
  .p-card-btn {
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 7px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
  }
  
  .p-card-btn:hover { background: #6d28d9; }
  
  /* =============================================
     PRODUCT MODAL
  ============================================= */
  .pmodal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.6);
    z-index: 9000;
    align-items: center;
    justify-content: center;
    padding: 20px;
  }
  
  .pmodal.open { display: flex; }
  
  .pmodal-box {
    background: #fff;
    border-radius: 14px;
    width: 100%;
    max-width: 860px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: modalIn .22s ease;
  }
  
  @keyframes modalIn {
    from { opacity: 0; transform: translateY(20px) scale(.97); }
    to   { opacity: 1; transform: translateY(0)   scale(1);    }
  }
  
  .pmodal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    background: #f3f4f6;
    border: none;
    border-radius: 50%;
    width: 34px;
    height: 34px;
    cursor: pointer;
    font-size: 14px;
    color: var(--dark);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: background .15s;
  }
  
  .pmodal-close:hover { background: #e5e7eb; }
  
  /* Two-column grid inside modal */
  .pmodal-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  
  .pmodal-img {
    background: #f3f4f6;
    border-radius: 14px 0 0 14px;
    overflow: hidden;
    aspect-ratio: 1 / 1;
  }
  
  .pmodal-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  
  .pmodal-details {
    padding: 28px 24px 28px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
  }
  
  .pmodal-brand {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: var(--accent);
    margin: 0;
  }
  
  .pmodal-title {
    font-size: 20px;
    font-weight: 800;
    margin: 0;
    line-height: 1.2;
  }
  
  .pmodal-cat {
    font-size: 12px;
    color: var(--mid);
    margin: 0;
  }
  
  .pmodal-desc {
    font-size: 13px;
    color: var(--mid);
    line-height: 1.6;
    margin: 0;
  }
  
  .pmodal-price-row {
    display: flex;
    align-items: center;
    gap: 12px;
  }
  
  .pmodal-price {
    font-size: 24px;
    font-weight: 900;
    color: var(--dark);
  }
  
  /* Fields */
  .pmodal-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }
  
  .pmodal-field label {
    font-size: 12px;
    font-weight: 700;
    color: var(--dark);
    text-transform: uppercase;
    letter-spacing: .6px;
  }
  
  /* Size pills */
  .size-pills,
  .color-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }
  
  .size-pill,
  .color-pill {
    border: 1.5px solid var(--border);
    background: #fff;
    border-radius: 6px;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all .12s;
    color: var(--dark);
  }
  
  .size-pill:hover,
  .color-pill:hover {
    border-color: var(--accent);
    color: var(--accent);
  }
  
  .size-pill.selected,
  .color-pill.selected {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
  }
  
  /* Quantity */
  .pmodal-qty-row { flex-direction: row; align-items: center; gap: 14px; }
  
  .qty-control {
    display: flex;
    align-items: center;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
  }
  
  .qty-control button {
    background: #f3f4f6;
    border: none;
    width: 34px;
    height: 34px;
    font-size: 16px;
    cursor: pointer;
    color: var(--dark);
    transition: background .12s;
  }
  
  .qty-control button:hover { background: #e5e7eb; }
  
  .qty-control input {
    width: 46px;
    text-align: center;
    border: none;
    outline: none;
    font-size: 14px;
    font-weight: 700;
    -moz-appearance: textfield;
  }
  
  .qty-control input::-webkit-outer-spin-button,
  .qty-control input::-webkit-inner-spin-button { -webkit-appearance: none; }
  
  /* Action buttons */
  .pmodal-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 4px;
  }
  
  .pmodal-actions form {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    width: 100%;
  }
  
  .btn-cart, .btn-buy, .btn-wish {
    flex: 1;
    border: none;
    border-radius: 8px;
    padding: 11px 14px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    transition: opacity .15s;
    text-decoration: none;
    min-width: 110px;
  }
  
  .btn-cart { background: var(--accent);  color: #fff; }
  .btn-buy  { background: #f59e0b;        color: #fff; }
  .btn-wish { background: #f3f4f6; color: var(--dark); border: 1.5px solid var(--border); }
  
  .btn-cart:hover, .btn-buy:hover, .btn-wish:hover { opacity: .85; }
  
  .btn-cart:disabled, .btn-wish:disabled { opacity: .4; cursor: not-allowed; }
  
  /* =============================================
     MOBILE  ≤ 900px
  ============================================= */
  @media (max-width: 900px) {
  
    /* Stack layout */
    .shop-wrapper {
      flex-direction: column;
      padding: 16px 14px 40px;
      gap: 14px;
    }
  
    /* Sidebar hides off-screen, slides in */
    .shop-sidebar {
      width: 100%;
      position: fixed;
      top: 98px;
      left: -110%;
      height: calc(100vh - 98px);
      overflow-y: auto;
      background: var(--bg);
      z-index: 800;
      transition: left 0.28s ease;
      padding: 16px;
      border-right: 1px solid var(--border);
      gap: 14px;
    }
  
    .shop-sidebar.open { left: 0; }
  
    /* Show filter button */
    .sidebar-toggle { display: flex; }
  
    /* Modal: stack vertically on mobile */
    .pmodal-grid { grid-template-columns: 1fr; }
  
    .pmodal-img {
      border-radius: 14px 14px 0 0;
      aspect-ratio: 4 / 3;
    }
  
    .pmodal-details { padding: 20px 18px 24px; }
  
    .pmodal-title { font-size: 17px; }
  
    /* Product grid: 2 columns on tablet */
    .product-grid {
      grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
      gap: 12px;
    }
  }
  
  @media (max-width: 480px) {
    .product-grid {
      grid-template-columns: repeat(2, 1fr);
      gap: 10px;
    }
  
    .p-card-title { font-size: 13px; }
    .p-card-price { font-size: 14px; }
  }