/*
 * Raadhaye Arts v4.13
 * Catalogue intelligence + responsive slider hardening.
 */

/* Hero: desktop artwork is the only asset visible from tablet upward. */
.rd-media-hero.rd-shop-image-only .rd-hero-desktop-img{
  display:block!important;
  visibility:visible!important;
  opacity:1!important;
  width:100%!important;
  height:100%!important;
  object-fit:cover!important;
  object-position:center!important;
}
.rd-media-hero.rd-shop-image-only .rd-hero-mobile-img{
  display:none!important;
  visibility:hidden!important;
  opacity:0!important;
}
@media (min-width:701px){
  .rd-media-hero.rd-shop-image-only .rd-hero-mobile-img{display:none!important}
  .rd-media-hero.rd-shop-image-only .rd-hero-desktop-img{display:block!important}
  .rd-media-hero.rd-shop-image-only .rd-media-hero-slides{aspect-ratio:8/3!important}
}
@media (max-width:700px){
  .rd-media-hero.rd-shop-image-only .rd-media-hero-slides{aspect-ratio:1122/1402!important}
  .rd-media-hero.rd-shop-image-only .rd-hero-desktop-img{display:none!important;visibility:hidden!important;opacity:0!important}
  .rd-media-hero.rd-shop-image-only .rd-hero-mobile-img{display:block!important;visibility:visible!important;opacity:1!important;object-fit:contain!important;object-position:center!important;background:#f8f4ee!important}
}

/* Product sliders: the card width is owned here, not by older theme layers. */
.rd-pslider .rd-track,
.rd-shop-product-slider-section .rd-track,
.rd-related-product-slider .rd-track,
.rd-recent-slider .rd-track{
  display:flex!important;
  flex-wrap:nowrap!important;
  align-items:stretch!important;
  gap:18px!important;
  overflow-x:auto!important;
  overflow-y:hidden!important;
  scroll-snap-type:x mandatory!important;
  scroll-padding-inline:2px!important;
  -webkit-overflow-scrolling:touch!important;
}
.rd-pslider .rd-track>.product-card,
.rd-shop-product-slider-section .rd-track>.product-card,
.rd-related-product-slider .rd-track>.product-card,
.rd-recent-slider .rd-track>.product-card{
  flex:0 0 calc((100% - 54px)/4)!important;
  width:calc((100% - 54px)/4)!important;
  max-width:calc((100% - 54px)/4)!important;
  min-width:0!important;
  flex-shrink:0!important;
  scroll-snap-align:start!important;
}
@media(max-width:1100px){
  .rd-pslider .rd-track>.product-card,
  .rd-shop-product-slider-section .rd-track>.product-card,
  .rd-related-product-slider .rd-track>.product-card,
  .rd-recent-slider .rd-track>.product-card{
    flex-basis:calc((100% - 36px)/3)!important;
    width:calc((100% - 36px)/3)!important;
    max-width:calc((100% - 36px)/3)!important;
  }
}
@media(max-width:700px){
  .rd-pslider .rd-track,
  .rd-shop-product-slider-section .rd-track,
  .rd-related-product-slider .rd-track,
  .rd-recent-slider .rd-track{gap:12px!important}
  .rd-pslider .rd-track>.product-card,
  .rd-shop-product-slider-section .rd-track>.product-card,
  .rd-related-product-slider .rd-track>.product-card,
  .rd-recent-slider .rd-track>.product-card{
    flex-basis:calc((100% - 12px)/2)!important;
    width:calc((100% - 12px)/2)!important;
    max-width:calc((100% - 12px)/2)!important;
  }
}

/* Never let a product slider look like a single-card catalogue. */
.rd-pslider .rd-track>.product-card:only-child,
.rd-shop-product-slider-section .rd-track>.product-card:only-child{
  flex-basis:min(100%,330px)!important;
  width:min(100%,330px)!important;
  max-width:min(100%,330px)!important;
}

/* Canonical collection page */
.rd-canonical-collection-hero .container{max-width:900px}
.rd-collection-toolbar{display:flex;align-items:center;justify-content:space-between;gap:20px;margin:0 0 28px;padding:14px 0;border-bottom:1px solid var(--rd-line);color:var(--rd-muted)}
.rd-collection-toolbar>div{display:flex;align-items:baseline;gap:8px}
.rd-collection-toolbar strong{font-size:24px;color:var(--rd-black)}
.rd-collection-toolbar span{font-size:13px}

/* Recent browsing should feel like a real catalogue section, not an empty shell. */
.rd-recent-view-section[hidden]{display:none!important}
.rd-recent-view-section .section-head-row{margin-bottom:26px}
.rd-recent-card .pc-img{background:#f7f5f2!important}
.rd-recent-card .pc-img img{object-fit:contain!important;padding:8px!important}

/* Category mosaic spacing after canonical dedupe. */
.rd-category-mosaic-card{animation:rdCategoryIn .5s ease both;animation-delay:var(--delay,0s)}
@keyframes rdCategoryIn{from{opacity:0;transform:translateY(14px)}to{opacity:1;transform:translateY(0)}}
@media(prefers-reduced-motion:reduce){.rd-category-mosaic-card{animation:none}}

/* Catalogue-specific smart filters */
.rd-smart-filters{display:grid;grid-template-columns:minmax(240px,2fr) repeat(4,minmax(120px,1fr)) auto;gap:9px;align-items:center;width:100%}
.rd-smart-filters input,.rd-smart-filters select{width:100%;min-height:42px;border:1px solid var(--rd-line);border-radius:9px;background:#fff;color:var(--rd-black);padding:9px 11px;outline:none}
.rd-smart-filters input:focus,.rd-smart-filters select:focus{border-color:var(--rd-red);box-shadow:0 0 0 3px rgba(var(--rd-red-rgb),.08)}
@media(max-width:1100px){.rd-smart-filters{grid-template-columns:repeat(3,minmax(0,1fr))}.rd-smart-filters input[type=search]{grid-column:1/-1}}
@media(max-width:700px){.rd-smart-filters{grid-template-columns:1fr 1fr}.rd-smart-filters input[type=search]{grid-column:1/-1}.rd-smart-filters .btn{grid-column:1/-1;width:100%}}

/* Size discovery */
.rd-size-discovery{background:linear-gradient(180deg,#fff,#fbf8f4)}
.rd-size-chip-grid{display:grid;grid-template-columns:repeat(8,minmax(0,1fr));gap:10px}
.rd-size-chip{display:grid;gap:4px;padding:15px 13px;border:1px solid var(--rd-line);border-radius:13px;background:#fff;text-decoration:none;transition:transform .2s ease,box-shadow .2s ease,border-color .2s ease}
.rd-size-chip:hover{transform:translateY(-3px);border-color:var(--rd-red);box-shadow:0 10px 28px rgba(14,14,16,.08)}
.rd-size-chip strong{font-size:16px;color:var(--rd-black)}
.rd-size-chip span{display:flex;align-items:center;gap:4px;color:var(--rd-muted);font-size:10px}
.rd-size-chip svg{width:11px;height:11px}
@media(max-width:1100px){.rd-size-chip-grid{grid-template-columns:repeat(4,minmax(0,1fr))}}
@media(max-width:700px){.rd-size-chip-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.rd-size-chip{padding:12px 11px}}

/* Material discovery stays hidden when the live catalogue has only one material. */
.rd-material-discovery{background:#fff}
.rd-material-chip-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
.rd-material-chip{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:18px;border:1px solid var(--rd-line);border-radius:14px;background:#fff;text-decoration:none;transition:.2s ease}
.rd-material-chip:hover{transform:translateY(-3px);border-color:var(--rd-red);box-shadow:0 12px 30px rgba(14,14,16,.08)}
.rd-material-chip strong{color:var(--rd-black);font-size:16px}.rd-material-chip span{font-size:10px;color:var(--rd-muted);display:flex;gap:4px;align-items:center}.rd-material-chip svg{width:12px;height:12px}
@media(max-width:700px){.rd-material-chip-grid{grid-template-columns:1fr 1fr}.rd-material-chip{padding:13px}}

/* Product card catalogue metadata */
.product-card .pc-meta{display:flex;align-items:center;justify-content:space-between;gap:8px;color:var(--rd-muted);font-size:10px;line-height:1.3;min-height:15px}
.product-card .pc-meta span:last-child{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:right}
