/* ==========================================================================
   NakshMart - Web collection page (front/web_collection.blade.php)
   Mobile-first. Loaded through @section('styles'), so it only affects
   pages whose <body> carries .page-wcollection.

   01. Tokens
   02. Hero
   03. Category pills & toolbar
   04. Layout & filters (sticky on desktop, drawer on mobile)
   05. Product grid (+ list view)
   06. Product card
   07. Active filters, empty state
   08. More collections
   09. Collections index (tiles)
   ========================================================================== */

/* 01. Tokens ------------------------------------------------------------- */
body.page-wcollection {
  --wc-edge: 14px;
  --wc-r: 0px;
  --wc-gold-text: #cb8161;
}

@media (min-width: 768px) {
  body.page-wcollection { --wc-edge: 20px; }
}

body.page-wcollection main .container { padding-inline: var(--wc-edge); }

.wc-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11px; font-weight: 500; line-height: 1.3; letter-spacing: .16em; text-transform: uppercase;
  color: var(--wc-gold-text);
}

.wc-eyebrow::before { content: ""; width: 18px; height: 1px; background: currentColor; opacity: .7; }

/* 02. Hero --------------------------------------------------------------- */
.wc-hero { position: relative; isolation: isolate; overflow: hidden; padding: 22px 0 26px; background: var(--primary-dark); }

.wc-hero-img { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; }

.wc-hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(0deg, rgba(var(--primary-rgb), .94), rgba(var(--primary-rgb), .66) 60%, rgba(var(--primary-rgb), .4));
}

.wc-hero-body { max-width: 700px; }
.wc-hero .wc-eyebrow { color: var(--gold); }

.wc-crumbs { justify-content: flex-start; margin-bottom: 14px; font-size: 12px; }

.wc-title {
  margin: 6px 0 8px;
  font-size: clamp(26px, 6.6vw, 46px); font-weight: 500; line-height: 1.12; letter-spacing: -.01em; color: var(--white);
}

.wc-subtitle { margin: 0 0 8px; font-size: clamp(14px, 3.6vw, 18px); line-height: 1.4; color: rgba(255, 255, 255, .92); }

.wc-desc {
  margin: 0; max-width: 62ch; font-size: 13px; line-height: 1.6; color: rgba(255, 255, 255, .82);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}

.wc-desc.is-open { display: block; -webkit-line-clamp: unset; }

.wc-more-btn {
  padding: 4px 0 0; border: 0; background: none;
  font-size: 12.5px; font-weight: 500; color: var(--gold); text-decoration: underline; text-underline-offset: 3px;
}

.wc-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }

.wc-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, .25); background: rgba(255, 255, 255, .1); backdrop-filter: blur(4px);
  font-size: 12px; color: var(--white);
}

.wc-chip i { font-size: 11px; color: var(--gold); }

@media (min-width: 768px) {
  .wc-hero { padding: 44px 0 48px; }
  .wc-hero::before {
    background: linear-gradient(90deg, rgba(var(--primary-rgb), .92), rgba(var(--primary-rgb), .62) 60%, rgba(var(--primary-rgb), .3));
  }
  .wc-eyebrow { font-size: 12px; }
  .wc-desc { font-size: 14.5px; }
  .wc-chip { font-size: 13px; }
}

/* 03. Pills & toolbar ---------------------------------------------------- */
.wc-section { padding: 18px 0 30px; }
.wc-section-tint { background: var(--cream); }

.wc-pills {
  display: flex; gap: 8px; margin: 0 calc(var(--wc-edge) * -1) 12px; padding: 2px var(--wc-edge);
  overflow-x: auto; scrollbar-width: none;
}

.wc-pills::-webkit-scrollbar { display: none; }

.wc-pill {
  display: inline-flex; flex: 0 0 auto; align-items: center; gap: 6px; padding: 7px 14px;
  border: 1px solid var(--divider); border-radius: var(--radius-pill); background: var(--white);
  font-size: 13px; font-weight: 500; line-height: 1.2; white-space: nowrap; color: var(--primary);
  transition: background-color .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease);
}

.wc-pill span { font-size: 11px; opacity: .65; }
.wc-pill:hover { border-color: var(--primary); color: var(--primary); }
.wc-pill.is-active { background: var(--primary); border-color: var(--primary); color: var(--white); }

.wc-toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 18px; padding: 10px 14px; border-radius: 0; background: var(--white); border: 1px solid var(--divider);
}

.wc-results { flex: 1; min-width: 0; margin: 0; font-size: 12.5px; }

.wc-filter-btn {
  position: relative; display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px;
  border: 1px solid var(--primary); border-radius: var(--radius-pill); background: var(--white);
  font-size: 12.5px; font-weight: 500; color: var(--primary);
}

.wc-filter-count {
  display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 18px;
  background: var(--gold); color: var(--primary-dark); font-size: 10px; font-weight: 700;
}

.wc-toolbar-tools { display: flex; align-items: center; gap: 8px; margin-left: auto; }

.wc-sort {
  max-width: 170px; padding: 7px 28px 7px 12px; border: 1px solid var(--divider); border-radius: var(--radius-pill);
  background-color: var(--white); font-size: 12.5px; color: var(--heading);
}

.wc-view { gap: 4px; }

.wc-view-btn {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--divider);
  border-radius: 50%; background: var(--white); font-size: 13px; color: var(--primary);
  transition: background-color .25s var(--ease), color .25s var(--ease);
}

.wc-view-btn.is-active, .wc-view-btn:hover { background: var(--primary); border-color: var(--primary); color: var(--white); }

@media (min-width: 768px) {
  .wc-section { padding: 28px 0 44px; }
  .wc-results { font-size: 13.5px; }
}

/* 04. Layout & filters --------------------------------------------------- */
.wc-layout { display: block; }

.wc-filters { --bs-offcanvas-width: min(340px, 88vw); }
.wc-filters .offcanvas-title { font-size: 20px; }
.wc-filter-form { display: flex; flex-direction: column; gap: 12px; }
.wc-widget { padding: 16px; border-radius: 0; background: var(--white); border: 1px solid var(--divider); }

.wc-widget-title {
  display: block; margin-bottom: 8px;
  font-family: var(--font-body); font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--heading);
}

.wc-search { position: relative; }

.wc-search input {
  width: 100%; padding: 9px 40px 9px 14px; border: 1px solid var(--divider); border-radius: var(--radius-pill);
  background: var(--white); font-size: 14px; color: var(--heading); outline: 0;
}

.wc-search input:focus, .wc-price input:focus { border-color: var(--primary); }

.wc-search button {
  position: absolute; top: 50%; right: 12px; padding: 0; border: 0; background: none; color: var(--primary); transform: translateY(-50%);
}

.wc-price { display: flex; align-items: center; gap: 8px; }

.wc-price input {
  width: 100%; min-width: 0; padding: 8px 12px; border: 1px solid var(--divider); border-radius: 10px;
  background: var(--white); font-size: 14px; color: var(--heading); outline: 0;
}

.wc-checks { max-height: 190px; margin: 0; padding: 0; overflow-y: auto; list-style: none; scrollbar-width: thin; }
.wc-check { display: flex; align-items: center; gap: 10px; padding: 5px 0; margin: 0; font-size: 14px; color: var(--text); cursor: pointer; }
.wc-check input { width: 16px; height: 16px; flex-shrink: 0; accent-color: var(--primary); }
.wc-check-switch { padding: 0; font-weight: 500; color: var(--heading); }
.wc-filter-actions { display: grid; gap: 8px; }

@media (min-width: 992px) {
  .wc-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 24px; align-items: start; }

  /* sticky filter column; scrolls on its own when taller than the screen */
  .wc-side {
    position: sticky; top: 84px; max-height: calc(100vh - 100px); overflow-y: auto; overscroll-behavior: contain;
    scrollbar-width: thin; scrollbar-color: rgba(var(--primary-rgb), .25) transparent;
    padding-right: 4px; margin-right: -4px;
  }
}

/* 05. Product grid ------------------------------------------------------- */
.wc-main { min-width: 0; }
.wc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 10px; }

@media (min-width: 768px) {
  .wc-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 14px; }
}

@media (min-width: 1200px) {
  .wc-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px 16px; }
}

/* list view: one wide row per piece */
.wc-grid.is-list { grid-template-columns: minmax(0, 1fr); }

@media (min-width: 576px) {
  .wc-grid.is-list .wc-card { flex-direction: row; }
  .wc-grid.is-list .wc-card-media { flex: 0 0 200px; aspect-ratio: 1 / 1; }
  .wc-grid.is-list .wc-card-body { justify-content: center; padding: 16px 20px; }
  .wc-grid.is-list .wc-card-name { font-size: 19px; }
  .wc-grid.is-list .wc-card-desc { display: block; }
  .wc-grid.is-list .wc-card-actions { margin-top: 12px; padding-top: 0; max-width: 260px; }
}

/* 06. Product card ------------------------------------------------------- */
.wc-card {
  position: relative; display: flex; flex-direction: column; min-width: 0; overflow: hidden;
  border: 1px solid var(--divider); border-radius: var(--wc-r); background: var(--white);
  transition: box-shadow .3s var(--ease), transform .3s var(--ease), border-color .3s var(--ease);
}

.wc-card-media { position: relative; overflow: hidden; aspect-ratio: 1 / 1; background: var(--cream); }
.wc-card-link { display: block; height: 100%; }

.wc-card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s var(--ease), opacity .4s var(--ease); }
.wc-card-media img.img-hover { position: absolute; inset: 0; opacity: 0; }

.wc-card-badges { position: absolute; top: 8px; left: 8px; z-index: 2; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; pointer-events: none; }

.wc-badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: var(--radius-pill);
  background: var(--primary); color: var(--white); font-size: 10.5px; font-weight: 600; line-height: 1.3; letter-spacing: .03em;
}

.wc-badge.is-sale { background: var(--badge-sale-bg); color: var(--white); }
.wc-badge.is-offer { background: var(--primary); color: var(--white); }
.wc-badge.is-offer i { color: var(--gold); }
.wc-badge.is-sold { background: #8b938f; }

.wc-card-tools { position: absolute; top: 8px; right: 8px; z-index: 2; display: flex; flex-direction: column; gap: 6px; }

.wc-tool {
  display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .94); box-shadow: 0 2px 8px rgba(var(--primary-rgb), .16);
  font-size: 13px; color: var(--primary);
  transition: background-color .25s var(--ease), color .25s var(--ease), transform .25s var(--ease);
}

.wc-tool:hover, .wc-tool.is-active { background: var(--primary); color: var(--white); }
.wc-tool:active { transform: scale(.9); }

.wc-card-body { display: flex; flex: 1; flex-direction: column; gap: 2px; min-width: 0; padding: 10px 10px 12px; }

.wc-card-label { font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--wc-gold-text); }

.wc-card-name { margin: 0; font-size: 15px; font-weight: 500; line-height: 1.3; }

.wc-card-name a { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--heading); }

.wc-card-desc { display: none; margin: 4px 0 0; font-size: 14px; line-height: 1.55; }

.wc-card-price { display: flex; align-items: baseline; gap: 6px; margin-top: 4px; }
.wc-card-price ins { font-size: 15px; font-weight: 600; text-decoration: none; color: var(--gold); }
.wc-card-price del { font-size: 12px; color: var(--compare-price); }

.wc-card-actions { display: flex; gap: 6px; margin-top: auto; padding-top: 10px; }

.wc-add {
  display: inline-flex; flex: 1; align-items: center; justify-content: center; gap: 6px; min-width: 0; padding: 9px 10px;
  border: 1px solid var(--primary); border-radius: var(--radius-pill); background: var(--primary);
  font-size: 12.5px; font-weight: 500; line-height: 1.2; color: var(--white); text-align: center;
  transition: background-color .25s var(--ease), border-color .25s var(--ease), color .25s var(--ease), transform .25s var(--ease);
}

.wc-add i { font-size: 12px; }
.wc-add-text, .wc-in-text { display: inline-flex; align-items: center; gap: 6px; }
.wc-in-text { display: none; }

.wc-card.is-in-cart .wc-add { border-color: var(--success); background: var(--success); }
.wc-card.is-in-cart .wc-add-text { display: none; }
.wc-card.is-in-cart .wc-in-text { display: inline-flex; }
.wc-add.is-disabled { border-color: var(--divider); background: var(--cream); color: var(--text); pointer-events: none; }

.wc-card .wc-remove {
  display: none; place-items: center; flex-shrink: 0; width: 36px; height: 36px; padding: 0;
  border: 1px solid var(--divider); border-radius: 50%; background: var(--white); box-shadow: none; font-size: 12px; color: var(--error);
  transition: background-color .25s var(--ease), color .25s var(--ease);
}

.wc-card.is-in-cart .wc-remove { display: inline-grid; }
.wc-card .wc-remove:hover { background: var(--error); border-color: var(--error); color: var(--white); }

.wc-card.nk-pcard-pop { animation: wcPop .45s var(--ease); }
@keyframes wcPop { 50% { transform: scale(1.025); } }

@media (hover: hover) {
  .wc-card:hover { transform: translateY(-3px); border-color: rgba(var(--gold-rgb), .55); box-shadow: 0 14px 30px rgba(var(--primary-rgb), .12); }
  .wc-card:hover .img-hover { opacity: 1; }
  .wc-card:hover .img-product { transform: scale(1.04); }
  .wc-add:hover { border-color: var(--gold); background: var(--gold); color: var(--primary-dark); }
  .wc-card.is-in-cart .wc-add:hover { border-color: var(--success); background: var(--success); color: var(--white); }
}

@media (min-width: 768px) {
  .wc-card-body { padding: 14px 14px 16px; }
  .wc-card-name { font-size: 17px; }
  .wc-card-price ins { font-size: 16px; }
  .wc-add { padding: 10px 14px; font-size: 13px; }
  .wc-tool { width: 36px; height: 36px; }
}

/* 07. Active filters, empty state ---------------------------------------- */
.wc-active { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 12px; }

.wc-tag {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border: 1px solid var(--divider); border-radius: var(--radius-pill);
  background: var(--white); font-size: 12px; color: var(--primary);
}

.wc-tag i { font-size: 10px; opacity: .7; }
.wc-tag:hover { border-color: var(--error); color: var(--error); }
.wc-clear { margin-left: 4px; font-size: 12px; font-weight: 500; color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }

.wc-empty { padding: 36px 16px; border-radius: var(--wc-r); background: var(--cream); text-align: center; }
.wc-empty > i { font-size: 34px; color: var(--gold); }
.wc-empty h2 { margin: 10px 0 6px; font-size: 22px; }
.wc-empty p { margin: 0 0 16px; font-size: 14px; }

/* 08. More collections --------------------------------------------------- */
.wc-more-head { margin-bottom: 14px; }
.wc-more-head h2 { margin: 4px 0 0; font-size: clamp(20px, 5.4vw, 30px); font-weight: 500; }
.wc-more-head h2 span { font-style: italic; font-weight: 400; }

.wc-more {
  display: flex; gap: 12px; margin: 0 calc(var(--wc-edge) * -1); padding: 0 var(--wc-edge);
  overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: var(--wc-edge); scrollbar-width: none;
}

.wc-more::-webkit-scrollbar { display: none; }

.wc-more-card {
  position: relative; isolation: isolate; display: flex; flex: 0 0 72%; align-items: flex-end; overflow: hidden;
  aspect-ratio: 16 / 10; border-radius: 0; color: var(--white); scroll-snap-align: start;
}

.wc-more-card img { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; transition: transform .7s var(--ease); }

.wc-more-card::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(0deg, rgba(var(--primary-rgb), .9), rgba(var(--primary-rgb), .05) 70%);
}

.wc-more-body { display: flex; flex-direction: column; padding: 12px 14px; }
.wc-more-body strong { font-family: var(--font-heading); font-size: 17px; font-weight: 500; line-height: 1.2; }
.wc-more-body small { font-size: 12px; color: rgba(255, 255, 255, .8); }

@media (hover: hover) {
  .wc-more-card:hover img { transform: scale(1.06); }
}

@media (min-width: 768px) {
  .wc-more { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; padding: 0; overflow: visible; }
  .wc-more-card { flex: none; aspect-ratio: 4 / 3; }
}

/* 09. Collections index (tiles) ------------------------------------------ */
.wc-tiles { display: grid; gap: 12px; }

/* phones: compact rows, image on the left */
.wc-tile {
  display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 12px; align-items: center; padding: 8px;
  border: 1px solid var(--divider); border-radius: var(--wc-r); background: var(--white);
  transition: box-shadow .3s var(--ease), transform .3s var(--ease), border-color .3s var(--ease);
}

.wc-tile-media { position: relative; display: block; overflow: hidden; aspect-ratio: 1 / 1; border-radius: 0; background: var(--cream); }
.wc-tile-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s var(--ease); }
.wc-tile-count { display: none; }

.wc-tile-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.wc-tile-title { margin: 0; font-size: 17px; font-weight: 500; line-height: 1.25; color: var(--heading); }

.wc-tile-sub {
  font-size: 12.5px; line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

.wc-tile-meta { font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--wc-gold-text); }
.wc-tile-go { display: none; }

@media (hover: hover) {
  .wc-tile:hover { transform: translateY(-3px); border-color: rgba(var(--gold-rgb), .55); box-shadow: 0 14px 30px rgba(var(--primary-rgb), .12); }
  .wc-tile:hover .wc-tile-media img { transform: scale(1.06); }
}

@media (min-width: 576px) {
  .wc-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
  .wc-tile { display: block; padding: 0; overflow: hidden; }
  .wc-tile-media { aspect-ratio: 16 / 10; border-radius: 0; }

  .wc-tile-count {
    position: absolute; top: 10px; left: 10px; display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px;
    border-radius: var(--radius-pill); background: rgba(var(--primary-rgb), .78); backdrop-filter: blur(4px);
    font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--white);
  }

  .wc-tile-count i { color: var(--gold); }
  .wc-tile-body { gap: 4px; padding: 14px 16px 16px; }
  .wc-tile-title { font-size: 21px; }
  .wc-tile-sub { font-size: 13.5px; }
  .wc-tile-meta { display: none; }

  .wc-tile-go {
    display: inline-flex; align-items: center; gap: 6px; margin-top: 6px;
    font-size: 13px; font-weight: 500; color: var(--primary);
  }

  .wc-tile-go i { font-size: 11px; transition: transform .25s var(--ease); }
}

@media (hover: hover) and (min-width: 576px) {
  .wc-tile:hover .wc-tile-go i { transform: translateX(4px); }
}

@media (min-width: 992px) {
  .wc-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
}
