/* GOODS PAGE LAYOUT + STYLES */

/* ===================================================
   MOBILE CATEGORY UI — DESKTOP HARD HIDE
   =================================================== */

.goods-cat-pill-wrapper,
.goods-cat-dropdown,
.goods-cat-option,
.goods-sub-option,
.goods-cat-option-group {
  display: none;
}

/* Page wrapper (gradient behind header and all content) */
.goods-page {
  min-height: 100vh;
  padding-top: 80px;
  background: radial-gradient(circle at top left, #d9edfc 0, transparent 55%),
    radial-gradient(circle at bottom right, #b8c3ff 0, transparent 50%),
    linear-gradient(135deg, #AFC2F5 0%, #BAC5F0 15%, #C9D1E9 45%, #E8ECF9 100%);
  background-attachment: fixed;
  background-size: 200% 200%;
  animation: goodsGradientShift 18s ease-in-out infinite alternate;
  color: #f7f7ff;
}

@keyframes goodsGradientShift {
  0% {
    background-position: 0% 0%;
  }

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 100%;
  }
}

/* Main layout */
.goods-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 32px;
  padding-bottom: 80px;
}

/* SIDEBAR */
.goods-sidebar {
  align-self: flex-start;
  padding: 20px 18px;
  margin-top: 105px;
  border-radius: 18px;
  background: rgba(8, 10, 24, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.goods-view {
  border-radius: 10px;
}

.goods-view.is-active {
  background: #ffffff;
  color: #000;
}

/* CATEGORY ROW (button + disclosure) */
.goods-cat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: #d9e2ff;
  font-size: 14px;
  letter-spacing: 0.06em;
  text-transform: lowercase;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.goods-cat:hover,
.goods-cat:focus-visible {
  outline: none;
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

.goods-cat.is-active {
  background: linear-gradient(135deg, #cbeafc, #8aa5ff);
  color: #111;
}

/* DISCLOSURE CARET (explicit affordance) */
.goods-cat::after {
  content: "▸";
  font-size: 11px;
  opacity: 0.6;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.goods-cat.has-subs::after {
  opacity: 0.85;
}

.goods-cat[aria-expanded="true"]::after {
  transform: rotate(90deg);
}

/* SUBLIST */
.goods-sublist {
  padding-left: 10px;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  margin-left: 7px;
  display: none;
  flex-direction: column;
  gap: 4px;
}

.goods-sublist.is-open {
  display: flex;
}

/* SUB BUTTONS */
.goods-sub {
  text-align: left;
  padding: 6px 10px;
  border-radius: 12px;
  border: none;
  background: transparent;
  color: #c7cce9;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.goods-sub:hover,
.goods-sub:focus-visible {
  outline: none;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.goods-sub.is-active {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

/* MAIN SECTION */
.goods-main {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Header / toolbar */
.goods-header {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.goods-header h1 {
  font-size: 24px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Toolbar */
.goods-toolbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  flex-wrap: nowrap;
}

.goods-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-left: auto;
}

.goods-filter-select select {
  height: 34px;
  padding: 6px 10px;
  font-size: 13px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(10, 12, 30, 0.85);
  color: #f7f7ff;
  transition: opacity 0.15s ease;
}

.goods-search {
  position: relative;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(10, 12, 30, 0.85);
  overflow: hidden;
}

.goods-search button {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  padding: 0;
  font-size: 14px;
  line-height: 1;
  color: #f7f7ff;
  opacity: 0.6;
  transition: opacity 0.15s ease;
  cursor: pointer;
}

.goods-search button:hover {
  opacity: 1;
}

.goods-search input {
  border: none;
  background: transparent;
  color: #f7f7ff;
  height: 34px;
  font-size: 13px;
  padding: 6px 36px 6px 12px; /* right padding reserves icon space */
}

.goods-search input::placeholder {
  color: rgba(247, 247, 255, 0.6);
}

/* PRODUCTS GRID */
.goods-grid {
  align-items: start;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}

/* Card */
.goods-card {
  position: relative;
  border-radius: 16px;
  padding: 10px;
  background: rgba(6, 7, 19, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.goods-card-title {
  font-size: 15px;
  line-height: 1.25;
  margin: 2px 0 0;
  min-height: 38px; /* enough for 2 lines */
}

.goods-card-meta {
  font-size: 13px;
  opacity: 0.85;
  min-height: 18px; /* reserves space even when empty */
}

.goods-card-bottom {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.goods-card-price {
  font-size: 13px;
}

.goods-card-media {
  width: 100%;
  aspect-ratio: 1 / 1;
  flex-shrink: 0;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(11, 12, 27, 0.421);
}

.goods-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.goods-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.6);
}

/* PAGINATION */
.goods-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 24px;
  font-size: 13px;
}

.goods-pagination button {
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: transparent;
  color: #f7f7ff;
  padding: 4px 10px;
  cursor: pointer;
}

.goods-pagination button:disabled {
  opacity: 0.3;
  cursor: default;
}

/* RESPONSIVE */
@media (max-width: 900px) {
  .goods-cat-pill-wrapper {
    display: inline-block;
  }

  .goods-cat-dropdown.is-open {
    display: block;
  }

  .goods-cat-option,
  .goods-sub-option,
  .goods-cat-option-group {
    display: block;
  }

  .goods-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .goods-sidebar {
    display: none;
  }

  .goods-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}