/* Gem Gems Site Manager v4.0.0 — canonical WooCommerce layer stylesheet.
   One source of truth for Shop/Category/Product Detail so rules never fight
   each other across files (section 79/218). Reuses the --ggsm-* variables
   and .ggsm-empty from assets/css/frontend.css; class names are namespaced
   ggsm-, and the original .ggsm-product-categories/.ggsm-product-cat class
   names from v3.1.1 are kept so existing overrides still apply. */

/* ---- Product Categories (hierarchical list) ---- */
.ggsm-product-categories { display: flex; flex-direction: column; gap: 14px; }
.ggsm-product-cat-list { display: flex; flex-direction: column; gap: 4px; margin: 0; padding: 0; list-style: none; }
.ggsm-product-cat-list-child { margin-top: 4px; margin-left: 16px; padding-left: 10px; border-left: 1px solid var(--ggsm-border, #e8e9ef); }
.ggsm-product-cat-item { width: 100%; }
.ggsm-product-cat { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 12px; border-radius: 8px; color: var(--ggsm-primary, #030735) !important; text-decoration: none !important; }
.ggsm-product-cat:hover { background: #f2f4f8; }
.ggsm-product-cat strong { min-width: 26px; padding: 2px 7px; border-radius: 999px; background: #eef0f5; text-align: center; font-size: 11px; flex-shrink: 0; }
.ggsm-product-cat.is-all { background: var(--ggsm-primary, #030735); color: #fff !important; }
.ggsm-product-cat.is-all strong { background: rgba(255, 255, 255, .18); color: #fff; }
.ggsm-product-cat.is-active:not(.is-all) { background: var(--ggsm-accent, #d5aa4c); color: #10152c !important; font-weight: 700; }
.ggsm-product-cat.is-ancestor-active { font-weight: 700; }
.ggsm-cat-thumb { width: 26px; height: 26px; border-radius: 6px; object-fit: cover; margin-right: 8px; }
.ggsm-cat-description { padding: 0 12px 8px; color: var(--ggsm-muted, #6f7890); font-size: 13px; line-height: 1.6; }
.ggsm-product-brands, .ggsm-product-tags, .ggsm-product-attributes ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.ggsm-product-brand, .ggsm-product-tag { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--ggsm-border, #e8e9ef); border-radius: 999px; color: var(--ggsm-primary, #030735) !important; text-decoration: none !important; font-size: 13px; }
.ggsm-product-brand.is-active { background: var(--ggsm-primary, #030735); color: #fff !important; border-color: var(--ggsm-primary, #030735); }
.ggsm-attribute-group { margin-bottom: 16px; }
.ggsm-attribute-group h4 { margin: 0 0 8px; color: var(--ggsm-primary, #030735); }

/* ---- Search ---- */
.ggsm-product-search { display: flex; border: 1px solid var(--ggsm-border, #e8e9ef); border-radius: 8px; overflow: hidden; }
.ggsm-product-search input[type="search"] { flex: 1; min-width: 0; padding: 10px 12px; border: 0; }
.ggsm-product-search button { width: 44px; border: 0; background: var(--ggsm-primary, #030735); color: #fff; font-size: 18px; cursor: pointer; }

/* ---- Shop / Category headers ---- */
.ggsm-shop-header, .ggsm-category-header { margin-bottom: 28px; }
.ggsm-shop-header h1, .ggsm-category-header h1 { margin: 6px 0 8px; color: var(--ggsm-primary, #030735); }
.ggsm-category-header-image img { width: 100%; max-height: 280px; object-fit: cover; border-radius: 14px; margin-bottom: 14px; }
.ggsm-shop-description, .ggsm-category-header-description { color: var(--ggsm-muted, #6f7890); line-height: 1.7; }
.ggsm-result-count { color: var(--ggsm-muted, #6f7890); font-size: 13px; }

/* ---- Sorting / Filters ---- */
.ggsm-product-sorting select { padding: 8px 10px; border: 1px solid var(--ggsm-border, #e8e9ef); border-radius: 8px; }
.ggsm-product-filters { display: flex; flex-direction: column; gap: 16px; padding: 18px; border: 1px solid var(--ggsm-border, #e8e9ef); border-radius: 12px; }
.ggsm-filter-group { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ggsm-filter-group legend { padding: 0 0 6px; font-weight: 700; color: var(--ggsm-primary, #030735); }
.ggsm-filter-price { flex-direction: row; align-items: center; gap: 8px; }
.ggsm-filter-price input { width: 100px; padding: 6px 8px; border: 1px solid var(--ggsm-border, #e8e9ef); border-radius: 6px; }
.ggsm-filter-checkbox { display: block; }
.ggsm-filter-actions { display: flex; align-items: center; gap: 14px; }
.ggsm-filter-clear { color: var(--ggsm-muted, #6f7890); text-decoration: underline; }

/* ---- Product grid ---- */
.ggsm-product-grid { display: grid; grid-template-columns: repeat(var(--ggsm-columns, 3), minmax(0, 1fr)); gap: 22px; list-style: none; margin: 0; padding: 0; }
.ggsm-product-card { position: relative; overflow: hidden; border: 1px solid var(--ggsm-border, #e8e9ef); border-radius: 14px; background: #fff; }
.ggsm-product-card-image { display: block; position: relative; aspect-ratio: 1 / 1; overflow: hidden; background: #f5f6f9; }
.ggsm-product-card-image img { width: 100%; height: 100%; object-fit: cover; }
.ggsm-product-badges { position: absolute; top: 10px; left: 10px; display: flex; flex-direction: column; gap: 4px; z-index: 1; }
.ggsm-badge { padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 800; color: #fff; }
.ggsm-badge-sale { background: #c0392b; }
.ggsm-badge-featured { background: var(--ggsm-accent, #d5aa4c); color: #10152c; }
.ggsm-badge-outofstock { background: #8a8a8a; }
.ggsm-badge-new { background: var(--ggsm-primary, #030735); }
.ggsm-product-card-body { padding: 16px; }
.ggsm-product-card-title { margin: 0 0 8px; font-size: 16px; }
.ggsm-product-card-title a { color: var(--ggsm-primary, #030735); text-decoration: none !important; }
.ggsm-product-card-price { display: block; margin-bottom: 10px; font-weight: 700; }
.ggsm-product-card-price ins { text-decoration: none; }
.ggsm-pagination ul { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 24px 0 0; padding: 0; }
.ggsm-pagination a, .ggsm-pagination span { display: inline-flex; min-width: 36px; height: 36px; align-items: center; justify-content: center; border: 1px solid var(--ggsm-border, #e8e9ef); border-radius: 8px; text-decoration: none !important; color: var(--ggsm-primary, #030735); }
.ggsm-pagination .current { background: var(--ggsm-primary, #030735); color: #fff; border-color: var(--ggsm-primary, #030735); }

/* ---- Product Gallery ---- */
.ggsm-product-gallery-main { position: relative; aspect-ratio: 1 / 1; border-radius: 14px; overflow: hidden; background: #f5f6f9; }
.ggsm-gallery-slide { display: none; position: absolute; inset: 0; }
.ggsm-gallery-slide.is-active { display: block; }
.ggsm-gallery-slide img { width: 100%; height: 100%; object-fit: contain; }
.ggsm-product-gallery-thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.ggsm-gallery-thumb { width: 64px; height: 64px; padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden; cursor: pointer; background: #f5f6f9; }
.ggsm-gallery-thumb.is-active { border-color: var(--ggsm-accent, #d5aa4c); }
.ggsm-gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* ---- Product Detail meta / video / tabs / SKU ---- */
.ggsm-product-sku, .ggsm-product-categories-current, .ggsm-product-tags-current { display: inline-block; margin-right: 14px; color: var(--ggsm-muted, #6f7890); font-size: 13px; }
.ggsm-product-gem-fields table, .ggsm-product-attributes-current, .ggsm-gemstone-tab-table { width: 100%; border-collapse: collapse; }
.ggsm-product-gem-fields th, .ggsm-product-gem-fields td,
.ggsm-product-attributes-current th, .ggsm-product-attributes-current td,
.ggsm-gemstone-tab-table th, .ggsm-gemstone-tab-table td { padding: 8px 10px; border-bottom: 1px solid var(--ggsm-border, #e8e9ef); text-align: left; }
.ggsm-product-gem-fields th, .ggsm-product-attributes-current th, .ggsm-gemstone-tab-table th { width: 35%; color: var(--ggsm-muted, #6f7890); font-weight: 600; }
.ggsm-product-video-list { display: flex; flex-direction: column; gap: 20px; }
.ggsm-product-video-item h4 { margin: 0 0 8px; color: var(--ggsm-primary, #030735); }

/* ---- Cart helpers ---- */
.ggsm-cart-count { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: var(--ggsm-accent, #d5aa4c); color: #10152c; font-size: 11px; font-weight: 800; }
.ggsm-mini-cart { min-width: 260px; }

/* ---- Layout: Shop = Products + Sidebar, stacks on tablet/mobile (section 80) ---- */
.ggsm-wc-layout { display: grid; grid-template-columns: 260px 1fr; gap: 32px; align-items: start; }
@media (max-width: 980px) {
    .ggsm-wc-layout { grid-template-columns: 1fr; }
    .ggsm-product-grid { grid-template-columns: repeat(min(2, var(--ggsm-columns, 3)), minmax(0, 1fr)); }
    .ggsm-filter-price { flex-wrap: wrap; }
}
@media (max-width: 600px) {
    .ggsm-product-grid { grid-template-columns: 1fr 1fr; gap: 14px; }
    .ggsm-contact-grid, .ggsm-product-cat-list-child { margin-left: 10px; }
}
