/* ==========================================================
   GLOWUP ONLINE — SHOP TEMPLATES CUSTOM CSS
   Paste this entire file into: Design > Custom CSS
========================================================== */


/* ==========================================================
   1. MAIN LAYOUT (Sidebar + Grid Framework)
========================================================== */
.product-list {
  display: flex !important;
  flex-wrap: nowrap;
  border-bottom: 1px solid var(--black);
  padding: 0 !important;
  gap: 0 !important;
}


/* ==========================================================
   2. SIDEBAR — Structure
========================================================== */
.product-list-nav-and-filters {
  border-right: 1px solid var(--black) !important;
  width: 250px;
  flex-shrink: 0;
  box-sizing: border-box;
  padding: 30px 24px !important;
}

/* Hide native filter UI to prevent FOUC before JS runs */
.product-list-filters-drawer-open-button-container,
.product-list-nav,
.product-list-filters,
.product-list-filters-drawer-overlay {
  display: none !important;
}


/* ==========================================================
   2b. SIDEBAR — Custom Sections (built by JS)
========================================================== */
.custom-sidebar-section {
  padding-bottom: 28px;
  margin-bottom: 28px;
}
.custom-sidebar-section:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
}

/* Section headings */
.custom-sidebar-heading {
  font-family: sans-serif;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 0 0 12px 0;
  padding-bottom: 12px;
  border-bottom: 1px dotted var(--black);
}

/* Link lists */
.custom-sidebar-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.custom-sidebar-list li {
  margin-bottom: 4px;
}
.custom-sidebar-list li:last-child {
  margin-bottom: 0;
}

/* Individual links */
.custom-sidebar-link {
  font-family: sans-serif;
  font-size: 0.9rem;

  text-decoration: none;
  transition: color 0.2s ease;
  display: inline-block;
}
.custom-sidebar-link:hover {

}
.custom-sidebar-link.active {
  font-weight: 700;

}

/* Superscript counts */
.custom-sidebar-link sup {
  font-size: 0.6rem;

  font-weight: 400;
  margin-left: 2px;
}


/* ==========================================================
   3. PRODUCT GRID SETUP
========================================================== */
.product-list-container {
  flex-grow: 1;
}
.product-list-layout-container {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  grid-gap: 0 !important;
  margin-bottom: -1px;
}


/* ==========================================================
   4. PRODUCT ITEM — Borders & Card Layout
========================================================== */
.product-list-item {
  border-right: 1px solid var(--black) !important;
  border-bottom: 1px solid var(--black) !important;
  box-sizing: border-box !important;
  margin: 0 !important;
  padding: 24px !important;
  display: flex;
  flex-direction: column;
  gap: 0 !important;
}

/* Remove right border on the last column */
.product-list-item:nth-child(3n) {
  border-right: none !important;
}
/* Remove bottom border on the last row */
.product-list-item:nth-last-child(-n+3) {
  border-bottom: none !important;
}

/* Make the inner link a flex column so tags stick to the bottom */
.product-list-item-link {
  display: flex !important;
  flex-direction: column;
  flex-grow: 1;
  text-decoration: none !important;
  gap: 0 !important;
}


/* ==========================================================
   5. PRODUCT IMAGE AREA
========================================================== */
.product-list-image-wrapper {
  background-color: #eae8e3;
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 12px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0;
  overflow: visible;
}
.product-list-item-image {
  margin: 0 !important;
  width: 100%;
}
.product-list-item-image img {
  border-radius: 2px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}


/* ==========================================================
   6. PRODUCT META — Title & Price Row
========================================================== */
.product-list-item-meta {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}
.product-list-title-price {
  display: flex !important;
  justify-content: space-between !important;
  align-items: baseline;
  margin-bottom: 8px;
  gap: 16px;
  width: 100%;
}
.product-list-item-title {
  font-size: 1.4rem;
  color: var(--black);
  margin: 0;
  white-space: nowrap;
  flex-shrink: 0;
}
.product-list-item-price {
  font-family: sans-serif;
  font-size: 1.1rem;
  color: var(--black);
  font-weight: 400;
  white-space: nowrap;
  margin-left: auto !important; /* push price to far right */
  text-align: right;
}


/* ==========================================================
   7. HIDE BADGES (for now)
========================================================== */
.product-list-item-status {
  display: none !important;
}


/* ==========================================================
   8. INJECTED ELEMENTS — Excerpt & Tag Pills (built by JS)
========================================================== */

/* Product description / excerpt */
.custom-product-excerpt {
  font-family: sans-serif;
  font-size: 0.82rem;
  line-height: 1.55;
  margin: 0 0 18px 0;
  flex-grow: 1; /* pushes tags to the bottom of the card */
}

/* Tag pill container */
.custom-product-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin-top: auto; /* stick to bottom */
}

/* Individual tag pill */
.custom-tag-pill {
  border: 1px solid var(--black);
  border-radius: 30px;
  padding: 0px 15px;
  line-height: 1.8;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--black);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: all 0.2s ease;
}
.custom-tag-pill:hover {
  background-color: var(--black);
  color: var(--white);
}


/* ==========================================================
   9. RESPONSIVE
========================================================== */

/* Tablet — 2 columns */
@media (max-width: 1024px) {
  .product-list-layout-container {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .product-list-item:nth-child(3n) {
    border-right: 1px solid var(--black) !important;
  }
  .product-list-item:nth-child(2n) {
    border-right: none !important;
  }
  .product-list-item:nth-last-child(-n+3) {
    border-bottom: 1px solid var(--black) !important;
  }
  .product-list-item:nth-last-child(-n+2) {
    border-bottom: none !important;
  }
}

/* ==========================================================
   9b. MOBILE FILTER DROPDOWNS (built by shop.js Part 1b)
   Hidden on desktop/tablet where the expanded sidebar shows.
========================================================== */
.glowup-mobile-filters {
  display: none;
}

/* Mobile — stacked layout, dropdown filters, 2-column grid */
@media (max-width: 768px) {
  .product-list {
    flex-direction: column !important;
  }

  /* 1. Page heading breathing room */
  .product-list-header {
    margin: 40px 20px !important;
  }

  .product-list-nav-and-filters {
    width: 100%;
    border-right: none !important;
    border-bottom: 1px solid var(--black) !important;
    padding: 20px !important;
  }

  /* 2. Sidebar lists -> two pill dropdowns */
  .custom-sidebar {
    display: none !important;
  }

  .glowup-mobile-filters {
    display: flex;
    gap: 8px;
  }

  .glowup-filter {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
  }

  .glowup-filter-label {
    font-family: sans-serif;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #222;
  }

  .glowup-filter select {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    border: 1px solid var(--black);
    border-radius: 100px;
    background-color: transparent;
    padding: 10px 38px 10px 16px;
    font-family: sans-serif;
    font-size: 0.85rem;
    color: var(--black);
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%231a1a1a' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
  }

  /* 3. Grid — 2 columns (the max-1024 border pattern already handles
     2-col edges; JS grid-edge classes refine on filter/resize) */
  .product-list-layout-container {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .product-list-item {
    padding: 14px !important;
  }

  /* Card tightening for the narrower columns */
  .product-list-item-title {
    font-size: 1.3rem !important;
  }
  .product-list-item-price {
    font-size: 1.3rem !important;
  }
  .product-list-title-price {
    gap: 8px !important;
    margin-bottom: 5px !important;
  }
  .custom-product-excerpt {
    font-size: 0.8125rem !important;
    margin-bottom: 12px !important;
  }
  .product-list-image-wrapper {
    padding: 12px !important;
    border-radius: 5px !important;
    margin-bottom: 10px !important;
  }
  .custom-tag-pill {
    font-size: 0.58rem !important;
    padding: 0 9px !important;
  }
}


/* ==========================================================
   10. JS-CALCULATED GRID EDGES
   Keeps borders correct when filtering returns partial rows.
   The nth-child rules above remain as a no-JS fallback.
========================================================== */
.product-list-layout-container.has-js-grid-edges .product-list-item {
  border-right: 1px solid var(--black) !important;
  border-bottom: 1px solid var(--black) !important;
}

.product-list-layout-container.has-js-grid-edges .product-list-item.is-row-end {
  border-right: none !important;
}

.product-list-layout-container.has-js-grid-edges .product-list-item.is-last-row {
  border-bottom: none !important;
}
