/* ==========================================================================
   SabbiraTech — WooCommerce Shop & Single Product Restyle
   Mirrors shop.html / product-detail.html (Tailwind look) using CSS only.
   Scoped to WooCommerce pages so header/footer & sidebar layout stay intact.
   ========================================================================== */

/* ───────────────────── Design tokens ───────────────────── */
:root {
    --st-primary: #0a2642;
    --st-accent: #00d4ff;
    --st-bg: #f6f7f8;
    --st-card: #ffffff;
    --st-border: #e2e8f0;
    --st-border-soft: #f1f5f9;
    --st-text: #0f172a;
    --st-text-soft: #475569;
    --st-text-muted: #94a3b8;
    --st-radius: 0.5rem;
    --st-pill: 9999px;
    --st-shadow: 0 10px 25px -5px rgb(15 23 42 / 0.08), 0 8px 10px -6px rgb(15 23 42 / 0.04);
}

/* ==========================================================================
   1. SHOP / ARCHIVE — layout shell (keep #primary + #secondary split)
   ========================================================================== */

/* Page background matches mockup */
body.woocommerce,
body.woocommerce-page,
body.single-product {
    background-color: var(--st-bg);
}

body.woocommerce .site-content,
body.woocommerce-page .site-content,
body.single-product .site-content {
    background-color: var(--st-bg);
}

/* Give the primary content area breathing room */
body.woocommerce #primary,
body.woocommerce-page #primary,
body.single-product #primary {
    padding-top: 2rem;
    padding-bottom: 2rem;
}

/* ───────────────────── Sidebar (#secondary) — restyle only, keep layout ───────────────────── */
body.woocommerce #secondary .widget,
body.woocommerce-page #secondary .widget {
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 0;
    margin-bottom: 2rem;
}

body.woocommerce #secondary .widget .widget-title,
body.woocommerce-page #secondary .widget .widget-title {
    font-size: 1.125rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: var(--st-text);
    border-bottom: 1px solid var(--st-border);
    padding-bottom: 0.6rem;
    margin-bottom: 1rem;
}

/* Category list — pill links like mockup */
body.woocommerce #secondary .widget ul.product-categories li,
body.woocommerce-page #secondary .widget ul.product-categories li {
    margin: 0.25rem 0;
}

body.woocommerce #secondary .widget ul.product-categories li a,
body.woocommerce-page #secondary .widget ul.product-categories li a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--st-radius);
    color: var(--st-text-soft);
    font-size: 0.875rem;
    font-weight: 500;
    transition: background 0.15s ease, color 0.15s ease;
}

body.woocommerce #secondary .widget ul.product-categories li a:hover,
body.woocommerce-page #secondary .widget ul.product-categories li a:hover {
    background: #e2e8f0;
    color: var(--st-primary);
}

body.woocommerce #secondary .widget ul.product-categories li.current-cat > a,
body.woocommerce-page #secondary .widget ul.product-categories li.current-cat > a {
    background: var(--st-primary);
    color: #ffffff;
    font-weight: 600;
}

body.woocommerce #secondary .widget ul.product-categories li .count,
body.woocommerce-page #secondary .widget ul.product-categories li .count {
    margin-left: auto;
    color: var(--st-text-muted);
    font-size: 0.75rem;
}

body.woocommerce #secondary .widget ul.product-categories li.current-cat > a .count,
body.woocommerce-page #secondary .widget ul.product-categories li.current-cat > a .count {
    color: rgb(255 255 255 / 0.7);
}

/* Layered nav checkboxes / radio pills */
body.woocommerce #secondary .widget.woocommerce-widget-layered-nav-list li,
body.woocommerce-page #secondary .widget.woocommerce-widget-layered-nav-list li {
    margin: 0.3rem 0;
    padding: 0;
}

body.woocommerce #secondary .widget .woocommerce-widget-layered-nav-list__item,
body.woocommerce-page #secondary .widget .woocommerce-widget-layered-nav-list__item {
    font-size: 0.875rem;
    color: var(--st-text-soft);
}

/* Price filter & select controls */
body.woocommerce #secondary .widget select,
body.woocommerce-page #secondary .widget select,
body.woocommerce #secondary .widget input[type="text"],
body.woocommerce-page #secondary .widget input[type="text"] {
    width: 100%;
    font-size: 0.875rem;
    background: #fff;
    border: 1px solid var(--st-border);
    border-radius: var(--st-radius);
    padding: 0.5rem 0.75rem;
    color: var(--st-text);
}

/* WooCommerce block filter widgets (new block theme markup) */
body.woocommerce #secondary .widget .wc-block-product-categories,
body.woocommerce-page #secondary .widget .wc-block-product-categories {
    gap: 0.25rem;
}

body.woocommerce #secondary .widget .wc-block-components-checkbox,
body.woocommerce-page #secondary .widget .wc-block-components-checkbox {
    font-size: 0.875rem;
    color: var(--st-text-soft);
}

body.woocommerce #secondary .widget .wc-block-components-price-slider,
body.woocommerce-page #secondary .widget .wc-block-components-price-slider {
    font-size: 0.875rem;
}

body.woocommerce #secondary .widget .wc-block-components-price-slider__range-input-progress,
body.woocommerce-page #secondary .widget .wc-block-components-price-slider__range-input-progress {
    background: var(--st-primary);
}

/* ───────────────────── Breadcrumbs ───────────────────── */
body.woocommerce nav.woocommerce-breadcrumb,
body.woocommerce-page nav.woocommerce-breadcrumb,
body.single-product nav.woocommerce-breadcrumb {
    font-size: 0.875rem;
    color: var(--st-text-muted);
    margin-bottom: 1.5rem;
}

body.woocommerce nav.woocommerce-breadcrumb a,
body.woocommerce-page nav.woocommerce-breadcrumb a,
body.single-product nav.woocommerce-breadcrumb a {
    color: var(--st-text-soft);
}

body.woocommerce nav.woocommerce-breadcrumb a:hover,
body.woocommerce-page nav.woocommerce-breadcrumb a:hover,
body.single-product nav.woocommerce-breadcrumb a:hover {
    color: var(--st-primary);
}

/* ───────────────────── Product grid — cards match shop.html ───────────────────── */
body.woocommerce ul.products,
body.woocommerce-page ul.products {
    gap: 1.5rem;
}

body.woocommerce ul.products li.product,
body.woocommerce-page ul.products li.product {
    position: relative;
    background: var(--st-card);
    border: 1px solid var(--st-border);
    border-radius: var(--st-radius);
    overflow: hidden;
    box-shadow: 0 1px 2px rgb(0 0 0 / 0.05);
    transition: box-shadow 0.25s ease, transform 0.25s ease;
    padding: 0;
    margin: 0;
    text-align: left;
}

body.woocommerce ul.products li.product:hover,
body.woocommerce-page ul.products li.product:hover {
    box-shadow: var(--st-shadow);
    transform: translateY(-2px);
}

/* Image area — square, zoom on hover */
body.woocommerce ul.products li.product .astra-shop-thumbnail-wrap,
body.woocommerce-page ul.products li.product .astra-shop-thumbnail-wrap,
body.woocommerce ul.products li.product a.woocommerce-LoopProduct-link img,
body.woocommerce-page ul.products li.product a.woocommerce-LoopProduct-link img {
    display: block;
    width: 100%;
}

body.woocommerce ul.products li.product .astra-shop-thumbnail-wrap,
body.woocommerce-page ul.products li.product .astra-shop-thumbnail-wrap {
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #f1f5f9;
}

body.woocommerce ul.products li.product .astra-shop-thumbnail-wrap img,
body.woocommerce-page ul.products li.product .astra-shop-thumbnail-wrap img,
body.woocommerce ul.products li.product a.woocommerce-LoopProduct-link img,
body.woocommerce-page ul.products li.product a.woocommerce-LoopProduct-link img {
    aspect-ratio: 1 / 1;
    object-fit: cover;
    transition: transform 0.5s ease;
}

body.woocommerce ul.products li.product:hover .astra-shop-thumbnail-wrap img,
body.woocommerce-page ul.products li.product:hover .astra-shop-thumbnail-wrap img,
body.woocommerce ul.products li.product:hover a.woocommerce-LoopProduct-link img,
body.woocommerce-page ul.products li.product:hover a.woocommerce-LoopProduct-link img {
    transform: scale(1.05);
}

/* Card body */
body.woocommerce ul.products li.product .astra-shop-summary-wrap,
body.woocommerce-page ul.products li.product .astra-shop-summary-wrap {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

body.woocommerce ul.products li.product .astra-shop-summary-wrap > a,
body.woocommerce-page ul.products li.product .astra-shop-summary-wrap > a,
body.woocommerce ul.products li.product .woocommerce-loop-product__link,
body.woocommerce-page ul.products li.product .woocommerce-loop-product__link {
    color: inherit;
}

/* Category label */
body.woocommerce ul.products li.product .ast-woo-product-category,
body.woocommerce-page ul.products li.product .ast-woo-product-category,
body.woocommerce ul.products li.product .ast-loop-product__link + .ast-woo-product-category,
body.woocommerce-page ul.products li.product .ast-loop-product__link + .ast-woo-product-category {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--st-text-muted);
    margin: 0;
}

/* Title */
body.woocommerce ul.products li.product .woocommerce-loop-product__title,
body.woocommerce-page ul.products li.product .woocommerce-loop-product__title,
body.woocommerce ul.products li.product h2,
body.woocommerce-page ul.products li.product h2 {
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--st-text);
    margin: 0;
    letter-spacing: -0.01em;
    /* line-clamp-1 */
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Short description in loop */
body.woocommerce ul.products li.product .woocommerce-loop-product__desc,
body.woocommerce-page ul.products li.product .woocommerce-loop-product__desc {
    font-size: 0.875rem;
    color: var(--st-text-soft);
    line-height: 1.4;
    margin: 0 0 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Price */
body.woocommerce ul.products li.product .price,
body.woocommerce-page ul.products li.product .price {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--st-primary);
    margin-top: auto;
}

body.woocommerce ul.products li.product .price del,
body.woocommerce-page ul.products li.product .price del {
    color: var(--st-text-muted);
    font-weight: 500;
    font-size: 0.875rem;
    opacity: 1;
}

body.woocommerce ul.products li.product .price ins,
body.woocommerce-page ul.products li.product .price ins {
    text-decoration: none;
}

body.woocommerce ul.products li.product .price .woocommerce-Price-amount,
body.woocommerce-page ul.products li.product .price .woocommerce-Price-amount {
    color: inherit;
}

/* Add to cart button */
body.woocommerce ul.products li.product .button.add_to_cart_button,
body.woocommerce-page ul.products li.product .button.add_to_cart_button,
body.woocommerce ul.products li.product a.button,
body.woocommerce-page ul.products li.product a.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--st-primary);
    color: #ffffff;
    border: 0;
    border-radius: var(--st-radius);
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.6rem 1rem;
    transition: background 0.15s ease;
    margin-top: 0.25rem;
}

body.woocommerce ul.products li.product .button.add_to_cart_button:hover,
body.woocommerce-page ul.products li.product .button.add_to_cart_button:hover,
body.woocommerce ul.products li.product a.button:hover,
body.woocommerce-page ul.products li.product a.button:hover {
    background: #0e3a63;
    color: #ffffff;
}

/* Badges — New / Sale */
body.woocommerce ul.products li.product span.onsale,
body.woocommerce-page ul.products li.product span.onsale {
    top: 0.75rem;
    left: 0.75rem;
    right: auto;
    min-height: auto;
    min-width: auto;
    line-height: 1;
    background: #dc2626;
    color: #ffffff;
    border-radius: 0.25rem;
    padding: 0.3rem 0.5rem;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: none;
}




body.woocommerce ul.products li.product .ast-on-card-button,
body.woocommerce-page ul.products li.product .ast-on-card-button {
    background: transparent;
    border: 0;
}

/* Out-of-stock info */
body.woocommerce ul.products li.product .ast-shop-product-out-of-stock,
body.woocommerce-page ul.products li.product .ast-shop-product-out-of-stock {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: var(--st-primary);
    color: #fff;
    border-radius: 0.25rem;
    padding: 0.3rem 0.5rem;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Star rating color */
body.woocommerce ul.products li.product .star-rating span::before,
body.woocommerce-page ul.products li.product .star-rating span::before,
body.woocommerce .star-rating span::before,
body.woocommerce-page .star-rating span::before {
    color: #f59e0b;
}

/* ───────────────────── Sort dropdown & result count ───────────────────── */
body.woocommerce .woocommerce-ordering select,
body.woocommerce-page .woocommerce-ordering select,
body.woocommerce .woocommerce-ordering .orderby,
body.woocommerce-page .woocommerce-ordering .orderby {
    font-size: 0.875rem;
    background: #fff;
    border: 1px solid var(--st-border);
    border-radius: var(--st-radius);
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    color: var(--st-text);
}

body.woocommerce .woocommerce-result-count,
body.woocommerce-page .woocommerce-result-count {
    font-size: 0.875rem;
    color: var(--st-text-muted);
}

/* ───────────────────── Pagination ───────────────────── */
body.woocommerce nav.woocommerce-pagination,
body.woocommerce-page nav.woocommerce-pagination {
    margin-top: 2.5rem;
}

body.woocommerce nav.woocommerce-pagination ul,
body.woocommerce-page nav.woocommerce-pagination ul {
    border: 0;
}

body.woocommerce nav.woocommerce-pagination ul li,
body.woocommerce-page nav.woocommerce-pagination ul li {
    border: 1px solid var(--st-border);
    border-radius: var(--st-radius);
    overflow: hidden;
    margin: 0 0.25rem;
}

body.woocommerce nav.woocommerce-pagination ul li a,
body.woocommerce nav.woocommerce-pagination ul li span,
body.woocommerce-page nav.woocommerce-pagination ul li a,
body.woocommerce-page nav.woocommerce-pagination ul li span {
    min-width: 2.5rem;
    height: 2.5rem;
    line-height: 2.5rem;
    padding: 0;
    color: var(--st-text-soft);
    background: #fff;
}

body.woocommerce nav.woocommerce-pagination ul li span.current,
body.woocommerce-page nav.woocommerce-pagination ul li span.current {
    background: var(--st-primary);
    color: #fff;
    font-weight: 700;
}

/* ==========================================================================
   2. SINGLE PRODUCT — product-detail.html look
   ========================================================================== */

body.single-product div.product {
    display: block;
}

body.single-product div.product div.images,
body.single-product div.product div.summary {
    float: none;
    width: 100%;
}

/* Gallery — main square rounded image + thumbnail row */
body.single-product div.product .woocommerce-product-gallery {
    margin-bottom: 1.5rem;
}

body.single-product div.product .woocommerce-product-gallery__image {
    border: 1px solid var(--st-border);
    border-radius: var(--st-radius);
    overflow: hidden;
    background: #fff;
}

body.single-product div.product .woocommerce-product-gallery__image img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    background: #fff;
}

body.single-product div.product .woocommerce-product-gallery .flex-control-thumbs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-top: 1rem;
}

body.single-product div.product .woocommerce-product-gallery .flex-control-thumbs li {
    float: none;
    width: auto;
    margin: 0;
}

body.single-product div.product .woocommerce-product-gallery .flex-control-thumbs img {
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border: 1px solid var(--st-border);
    border-radius: var(--st-radius);
    opacity: 0.7;
    transition: opacity 0.15s ease, border-color 0.15s ease;
}

body.single-product div.product .woocommerce-product-gallery .flex-control-thumbs img:hover,
body.single-product div.product .woocommerce-product-gallery .flex-control-thumbs img.flex-active {
    opacity: 1;
    border-color: var(--st-primary);
}

/* Title */
body.single-product div.product .product_title {
    font-size: 1.75rem;
    font-weight: 900;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: var(--st-text);
    margin-bottom: 0.5rem;
}

/* Rating / stock row */
body.single-product div.product .woocommerce-product-rating {
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
}

body.single-product div.product .woocommerce-product-rating .star-rating {
    margin-right: 0.5rem;
}

body.single-product div.product p.stock {
    font-size: 0.875rem;
    font-weight: 600;
    color: #16a34a;
}

body.single-product div.product p.stock.out-of-stock {
    color: #dc2626;
}

/* Price box */
body.single-product div.product p.price {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--st-primary);
    margin-bottom: 1rem;
}

body.single-product div.product p.price del {
    color: var(--st-text-muted);
    font-size: 1.125rem;
    font-weight: 400;
    opacity: 1;
}

body.single-product div.product p.price ins {
    text-decoration: none;
    font-weight: 800;
}

/* Short description */
body.single-product div.product .woocommerce-product-details__short-description,
body.single-product div.product .summary .woocommerce-product-details__short-description,
body.single-product div.product .summary > div:first-of-type {
    font-size: 0.9rem;
    color: var(--st-text-soft);
    line-height: 1.6;
}

/* Quantity */
body.single-product div.product form.cart .quantity .qty {
    width: 4.5rem;
    height: 3rem;
    border: 1px solid var(--st-border);
    border-radius: var(--st-radius);
    font-size: 1rem;
    color: var(--st-text);
}

/* Add to cart button */
body.single-product div.product form.cart .single_add_to_cart_button {
    height: 3rem;
    padding: 0 1.5rem;
    background: var(--st-primary);
    color: #fff;
    border: 0;
    border-radius: var(--st-radius);
    font-size: 1rem;
    font-weight: 700;
    transition: background 0.15s ease;
}

body.single-product div.product form.cart .single_add_to_cart_button:hover {
    background: #0e3a63;
    color: #fff;
}

/* Meta (sku/category/tags) as subtle rows */
body.single-product div.product .product_meta {
    display: flex;
    flex-direction: column;
}

body.single-product div.product .product_meta a {
    color: var(--st-text-soft);
}

/* ───────────────────── Tabs — underline-style bar like mockup ───────────────────── */
body.single-product div.product .woocommerce-tabs {
    border: 0;
    margin-top: 2rem;
}

body.single-product div.product .woocommerce-tabs ul.tabs {
    margin: 0;
    padding: 0;
    border-bottom: 1px solid var(--st-border);
}

body.single-product div.product .woocommerce-tabs ul.tabs::before {
    display: none;
}

body.single-product div.product .woocommerce-tabs ul.tabs li {
    margin: 0 1.5rem 0 0;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
}

body.single-product div.product .woocommerce-tabs ul.tabs li a {
    display: inline-block;
    padding: 1rem 0;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--st-text-muted);
    border-bottom: 2px solid transparent;
    text-decoration: none;
}

body.single-product div.product .woocommerce-tabs ul.tabs li.active a,
body.single-product div.product .woocommerce-tabs ul.tabs li a:hover {
    color: var(--st-primary);
    border-bottom-color: var(--st-primary);
}

body.single-product div.product .woocommerce-tabs .panel {
    padding: 1.5rem 0;
    font-size: 0.9rem;
    color: var(--st-text-soft);
    line-height: 1.7;
}

/* ───────────────────── Spec table — two-column key/value ───────────────────── */
body.single-product div.product table.woocommerce-product-attributes.shop_attributes {
    border: 1px solid var(--st-border);
    border-radius: var(--st-radius);
    overflow: hidden;
    border-collapse: collapse;
    width: 100%;
}

body.single-product div.product table.woocommerce-product-attributes.shop_attributes th,
body.single-product div.product table.woocommerce-product-attributes.shop_attributes td {
    padding: 0.9rem 1rem;
    border-bottom: 1px solid var(--st-border-soft);
    font-size: 0.875rem;
}

body.single-product div.product table.woocommerce-product-attributes.shop_attributes th {
    width: 35%;
    color: var(--st-text-muted);
    font-weight: 500;
    text-align: left;
    background: #f8fafc;
}

body.single-product div.product table.woocommerce-product-attributes.shop_attributes td {
    color: var(--st-text);
    font-weight: 500;
}

/* ───────────────────── Related products — same card style ───────────────────── */
body.single-product .related.products h2,
body.single-product .up-sells h2,
body.single-product .cross-sells h2 {
    font-size: 1.5rem;
    font-weight: 900;
    letter-spacing: -0.01em;
    margin-bottom: 1.5rem;
}

body.single-product .related.products ul.products,
body.single-product .up-sells ul.products,
body.single-product .cross-sells ul.products {
    gap: 1.5rem;
}

/* ───────────────────── Responsive tweaks ───────────────────── */
@media (max-width: 768px) {
    body.single-product div.product .product_title {
        font-size: 1.75rem;
    }

    body.single-product div.product p.price {
        font-size: 1.75rem;
    }

    body.woocommerce ul.products,
    body.woocommerce-page ul.products {
        gap: 1rem;
    }

    body.woocommerce ul.products li.product .astra-shop-summary-wrap,
    body.woocommerce-page ul.products li.product .astra-shop-summary-wrap {
        padding: 1rem;
    }
}