/* 1R ReStart — catalog.css
 * Canonical order: foundations → layout/components → states/integrations → responsive.
 */

/* ==========================================================================
   TOKENS / FOUNDATIONS
   ========================================================================== */

body.r1-category-card-overlay .woocommerce li.product-category{position:relative;min-height:220px;padding:0;border:0;background:var(--r1-bg);}

body.r1-category-card-overlay .woocommerce li.product-category a{display:block;height:100%;}

body.r1-category-card-overlay .woocommerce li.product-category a img{display:block;width:100%;height:100%;min-height:220px;margin:0;aspect-ratio:4/3;object-fit:cover;}

body.r1-category-card-overlay .woocommerce li.product-category:after{content:"";position:absolute;inset:auto 0 0;height:55%;background:linear-gradient(transparent,rgba(15,23,42,.78));pointer-events:none;}

/* ==========================================================================
   LAYOUT
   ========================================================================== */

.r1-store-sidebar{grid-column:1;grid-row:1;}

.r1-store-content{grid-column:2;}

.r1-store-sidebar .widget{padding:18px;border:1px solid var(--r1-border);border-radius:var(--r1-surface-radius);margin-bottom:18px;}

.r1-store-sidebar .widget-title{font-size:1rem;margin-top:0;}

.r1-store-layout{display:grid;grid-template-columns:var(--r1-sidebar-width) minmax(0,1fr);gap:var(--r1-sidebar-gap);}

.r1-store-layout.sidebar-left .r1-store-sidebar{grid-column:1;grid-row:1;}

.r1-store-layout.sidebar-left .r1-store-content{grid-column:2;grid-row:1;}

.r1-store-layout.sidebar-right{grid-template-columns:minmax(0,1fr) var(--r1-sidebar-width);}

.r1-store-layout.sidebar-right .r1-store-content{grid-column:1;grid-row:1;}

.r1-store-layout.sidebar-right .r1-store-sidebar{grid-column:2;grid-row:1;}

/* Canonical default category card: one WooCommerce implementation; Reactor category grid remains separate. */

/* ==========================================================================
   PRODUCTS / CATALOG
   ========================================================================== */

.r1-catalog-toolbar{display:flex;align-items:center;justify-content:space-between;gap:16px;margin:0 0 var(--r1-element-gap,20px);}

.r1-catalog-toolbar .woocommerce-ordering,.r1-catalog-toolbar .woocommerce-result-count{float:none;margin:0;}

.r1-catalog-toolbar .woocommerce-ordering{order:1;}

.r1-catalog-toolbar .woocommerce-result-count{order:2;text-align:right;}









:is(.woocommerce ul.products, ul.products.reactor-category-grid) li.product-category.reactor-category-card:hover{background:transparent;border:0;box-shadow:none;transform:none;outline:0;}

:is(.woocommerce ul.products, ul.products.reactor-category-grid) li.product-category.reactor-category-card>a.categories__content-item{width:100%;height:100%;box-sizing:border-box;}

:is(.woocommerce ul.products, ul.products.reactor-category-grid) li.product-category.reactor-category-card>a.categories__content-item img{background:#fff;}

.woocommerce ul.products li.product-category:not(.reactor-category-card){position:relative;display:flex;flex-direction:column;float:none;width:auto;min-width:0;height:100%;margin:0;padding:0;box-sizing:border-box;overflow:hidden;background:var(--r1-surface);border:1px solid var(--r1-border);border-radius:var(--r1-card-radius);box-shadow:0 10px 28px rgba(20,35,45,.07);transition:transform .25s ease,box-shadow .25s ease,border-color .25s ease;}

.woocommerce ul.products li.product-category:not(.reactor-category-card):hover{transform:translateY(-4px);border-color:color-mix(in srgb,var(--r1-hover) 35%,var(--r1-border));box-shadow:0 18px 42px rgba(20,35,45,.12);}

.woocommerce ul.products li.product-category:not(.reactor-category-card)>a{display:flex;flex-direction:column;width:100%;height:100%;color:var(--r1-text);text-decoration:none;}

.woocommerce ul.products li.product-category:not(.reactor-category-card)>a>img{display:block;order:1;width:calc(100% - 24px);height:auto;aspect-ratio:1/1;margin:12px auto 0;padding:12px;object-fit:contain;object-position:center;background:#fff;border-radius:0;box-sizing:border-box;}

.woocommerce ul.products li.product-category:not(.reactor-category-card) .woocommerce-loop-category__title{display:flex;align-items:baseline;gap:6px;min-height:0;order:2;margin:0;padding:16px;color:var(--r1-text);font-size:1rem;font-weight:600;line-height:1.25;}

.woocommerce ul.products li.product-category:not(.reactor-category-card) .count{margin-left:6px;padding:0;background:transparent;color:var(--r1-muted);font-size:.8em;font-weight:400;}

.woocommerce ul.products li.product-category:not(.reactor-category-card) :is(.button,.star-rating,.price){display:none!important;}

:is(.woocommerce ul.products, ul.products.reactor-category-grid) li.product-category.reactor-category-card{height:auto;overflow:visible;border-radius:0;transform:none;outline:0;display:block;float:none;width:auto;min-width:0;margin:0;padding:0;background:transparent;border:0;box-shadow:none;}

:is(.woocommerce ul.products, ul.products.reactor-category-grid) li.product-category.reactor-category-card>.categories__content-item{position:relative;display:flex;flex-direction:column;width:100%;min-height:100%;overflow:hidden;background:var(--r1-surface);border:1px solid var(--r1-border);border-radius:var(--r1-card-radius);box-shadow:0 10px 28px rgba(20,35,45,.07);text-decoration:none;transition:transform .25s ease,box-shadow .25s ease,border-color .25s ease;box-sizing:border-box;}

:is(.woocommerce ul.products, ul.products.reactor-category-grid) li.product-category.reactor-category-card>.categories__content-item:hover{transform:translateY(-4px);border-color:color-mix(in srgb,var(--r1-hover) 35%,var(--r1-border));box-shadow:0 18px 42px rgba(20,35,45,.12);}

:is(.woocommerce ul.products, ul.products.reactor-category-grid) li.product-category.reactor-category-card>.categories__content-item>img{display:block;order:1;width:calc(100% - 24px);height:auto;aspect-ratio:1/1;margin:12px auto 0;padding:12px;object-position:center;background:#fff;border-radius:0;box-sizing:border-box;}

:is(.woocommerce ul.products, ul.products.reactor-category-grid) li.product-category.reactor-category-card>.reactor-category-thumbnail--original>img{object-fit:contain;}

:is(.woocommerce ul.products, ul.products.reactor-category-grid) li.product-category.reactor-category-card>.reactor-category-thumbnail--stretch>img{object-fit:fill;}

:is(.woocommerce ul.products, ul.products.reactor-category-grid) li.product-category.reactor-category-card .categories__item-head{position:relative;order:2;display:flex;flex-direction:column;justify-content:center;gap:6px;width:100%;min-height:88px;margin:0;padding:16px 56px 18px 16px;box-sizing:border-box;}

:is(.woocommerce ul.products, ul.products.reactor-category-grid) li.product-category.reactor-category-card .categories__item-title{margin:0;color:var(--r1-text);font-size:1rem;font-weight:600;line-height:1.25;display:-webkit-box;overflow:hidden;-webkit-line-clamp:2;-webkit-box-orient:vertical;}

:is(.woocommerce ul.products, ul.products.reactor-category-grid) li.product-category.reactor-category-card .categories__item-count{margin:0;color:var(--r1-muted);font-size:.8125rem;font-weight:400;}

:is(.woocommerce ul.products, ul.products.reactor-category-grid) li.product-category.reactor-category-card .categories__item-btn{position:absolute;right:16px;bottom:22px;width:34px;height:34px;}

:is(.woocommerce ul.products, ul.products.reactor-category-grid) li.product-category.reactor-category-card .categories__item-btn svg{display:block;width:34px;height:34px;}

:is(.woocommerce ul.products, ul.products.reactor-category-grid) li.product-category.reactor-category-card .categories__item-btn circle{fill:var(--r1-bg);transition:fill .2s ease;}

:is(.woocommerce ul.products, ul.products.reactor-category-grid) li.product-category.reactor-category-card .categories__item-btn path{stroke:var(--r1-text);transition:stroke .2s ease;}

:is(.woocommerce ul.products, ul.products.reactor-category-grid) li.product-category.reactor-category-card>.categories__content-item:hover .categories__item-btn circle{fill:var(--r1-hover);}

:is(.woocommerce ul.products, ul.products.reactor-category-grid) li.product-category.reactor-category-card>.categories__content-item:hover .categories__item-btn path{stroke:#fff;}

/* Reactor category grid reuses the canonical card rules above.
   Only grid-specific geometry and interaction differences remain here. */
ul.products.reactor-category-grid li.product-category.reactor-category-card{height:100%;}
ul.products.reactor-category-grid li.product-category.reactor-category-card>.categories__content-item{height:100%;}
ul.products.reactor-category-grid li.product-category.reactor-category-card>.categories__content-item>img{object-fit:contain;}
ul.products.reactor-category-grid li.product-category.reactor-category-card .categories__item-btn{z-index:10;pointer-events:none!important;}

.woocommerce ul.products:has(>li.product-category){grid-template-columns:repeat(var(--r1-category-columns,4),minmax(0,1fr));}

body.r1-category-card-overlay .woocommerce li.product-category .woocommerce-loop-category__title{position:absolute;z-index:2;left:16px;right:16px;bottom:14px;margin:0;padding:0;color:#fff;text-align:left;}

/* ==========================================================================
   FORMS / CONTROLS
   ========================================================================== */

.woocommerce .woocommerce-ordering select{border:1px solid var(--r1-border);border-radius:10px;padding:.65rem .8rem;background:#fff;}

/* ==========================================================================
   STATES / UTILITIES
   ========================================================================== */

.r1-subcategory-chip:hover,
.r1-subcategory-chip:focus-visible{border-color:var(--r1-primary);background:var(--r1-bg);color:var(--r1-primary);}

.r1-subcategory-chip:active{transform:translateY(1px);}

.r1-subcategory-chip:focus-visible{outline:2px solid var(--r1-primary);outline-offset:2px;}

/* ==========================================================================
   INTEGRATIONS
   ========================================================================== */

.woocommerce .woocommerce-breadcrumb{color:var(--r1-muted);font-size:.9rem;margin-bottom:22px;}

.woocommerce .woocommerce-result-count{color:var(--r1-muted);}

/* ==========================================================================
   OTHER
   ========================================================================== */

.r1-category-description{color:var(--r1-text);line-height:var(--r1-body-line-height,1.6);}

.r1-category-description>.term-description{margin:0;}

.r1-category-description--before{margin:0 0 var(--r1-element-gap,20px);}

.r1-category-description--after{margin:var(--r1-section-gap,48px) 0 0;}

.r1-subcategory-chips{margin:0 0 var(--r1-element-gap,20px);}

.r1-subcategory-chips__list{display:flex;flex-wrap:wrap;align-items:center;gap:10px;}

.r1-subcategory-chip{display:inline-flex;align-items:center;min-height:38px;padding:8px 14px;border:1px solid var(--r1-border);border-radius:var(--r1-control-radius,9px);background:var(--r1-surface);color:var(--r1-text);font-size:var(--r1-small-size,14px);font-weight:500;line-height:1.2;text-decoration:none;box-shadow:none;transition:background-color .16s ease,border-color .16s ease,color .16s ease,transform .08s ease;}

/* ==========================================================================
   RESPONSIVE / CONDITIONAL
   ========================================================================== */

@media (max-width:1100px){
.r1-store-layout{grid-template-columns:230px minmax(0,1fr);}
}

@media (max-width:800px){
.r1-store-layout,.r1-store-layout.sidebar-right{display:block;}
.r1-store-sidebar{margin-top:24px;margin-bottom:24px;}
}

@media (max-width:640px){
.r1-catalog-toolbar{align-items:flex-start;flex-direction:column;}
.r1-catalog-toolbar .woocommerce-result-count{text-align:left;}
.woocommerce ul.products:not(.reactor-category-grid) li.product-category:not(.reactor-category-card) a img{width:calc(100% - 16px);margin-top:8px;padding:7px;}
.woocommerce ul.products:not(.reactor-category-grid) li.product-category:not(.reactor-category-card) .woocommerce-loop-category__title{padding:12px;font-size:.88rem;}
.woocommerce ul.products li.product-category.reactor-category-card>.categories__content-item>img{width:calc(100% - 16px);margin-top:8px;padding:8px;}
.woocommerce ul.products li.product-category.reactor-category-card .categories__item-head{min-height:72px;padding:10px 38px 12px 10px;gap:4px;}
.woocommerce ul.products li.product-category.reactor-category-card .categories__item-title{font-size:.8125rem;}
.woocommerce ul.products li.product-category.reactor-category-card .categories__item-count{font-size:.6875rem;}
.woocommerce ul.products li.product-category.reactor-category-card .categories__item-btn{right:10px;bottom:18px;width:26px;height:26px;}
.woocommerce ul.products li.product-category.reactor-category-card .categories__item-btn svg{width:26px;height:26px;}

.woocommerce ul.products:not(:has(>li.product-category)),.woocommerce-page ul.products:not(:has(>li.product-category)){grid-template-columns:repeat(var(--r1-products-mobile-columns,2),minmax(0,1fr));}
.woocommerce ul.products:has(>li.product-category),.woocommerce-page ul.products:has(>li.product-category){grid-template-columns:repeat(var(--r1-category-mobile-columns,2),minmax(0,1fr));}
}

@media (min-width:641px) and (max-width:1024px){
.woocommerce ul.products:not(:has(>li.product-category)),.woocommerce-page ul.products:not(:has(>li.product-category)){grid-template-columns:repeat(var(--r1-products-tablet-columns,3),minmax(0,1fr));}
.woocommerce ul.products:has(>li.product-category),.woocommerce-page ul.products:has(>li.product-category){grid-template-columns:repeat(var(--r1-category-tablet-columns,3),minmax(0,1fr));}
}

@media (max-width:767px){
.r1-subcategory-chips__list{gap:8px;}
.r1-subcategory-chip{min-height:36px;padding:7px 12px;}
}

@media (prefers-reduced-motion:reduce){
.r1-subcategory-chip{transition:none;}
}
