/*
 * Go2EXQL v1.9 — Unified WooCommerce presentation.
 * Presentation only: no changes to cart calculations, checkout validation,
 * WooCommerce templates, product data, licensing, or account endpoints.
 * Works with classic WooCommerce templates and Cart/Checkout blocks.
 */

/* Shared spacing: maintain the existing full-width theme shell without
   turning software product pages into uncomfortably wide reading columns. */
body.single-product .site-content,
body.post-type-archive-product .site-content,
body.tax-product_cat .site-content,
body.woocommerce-cart .site-content,
body.woocommerce-checkout .site-content { background: #FAF8F3; }
body.single-product:not(.home) .site-content,
body.post-type-archive-product:not(.home) .site-content,
body.tax-product_cat:not(.home) .site-content {
    padding-top: clamp(20px, 2.5vw, 36px);
    padding-bottom: clamp(45px, 5vw, 75px);
}
body.single-product .site-content > .col-full,
body.post-type-archive-product .site-content > .col-full,
body.tax-product_cat .site-content > .col-full,
body.woocommerce-cart .site-content > .col-full,
body.woocommerce-checkout .site-content > .col-full {
    max-width: 1450px;
    margin-inline: auto;
}
body.single-product .storefront-breadcrumb,
body.post-type-archive-product .storefront-breadcrumb,
body.tax-product_cat .storefront-breadcrumb {
    padding: 14px 0 0;
    margin-bottom: 0;
}
body.single-product .woocommerce-breadcrumb,
body.post-type-archive-product .woocommerce-breadcrumb,
body.tax-product_cat .woocommerce-breadcrumb {
    margin: 0;
    color: var(--g2-muted);
    font-size: 12px;
}
body.single-product .storefront-breadcrumb .col-full,
body.post-type-archive-product .storefront-breadcrumb .col-full,
body.tax-product_cat .storefront-breadcrumb .col-full {
    box-sizing: border-box;
    max-width: 1450px;
    width: calc(100% - clamp(32px, 5vw, 160px));
    padding-inline: 0;
    margin-inline: auto;
}

/* Shared controls and feedback. Keep WooCommerce's form and event semantics. */
.woocommerce .button,
.woocommerce button.button,
.woocommerce a.button,
.woocommerce input.button,
.wc-block-components-button:not(.is-link) {
    border-radius: 7px;
    border: 1px solid var(--g2-green);
    background: var(--g2-green);
    color: #fff;
    box-shadow: none;
    font-size: 14px;
    font-weight: 650;
    line-height: 1.35;
    padding: 11px 19px;
    text-decoration: none;
    transition: background-color .18s, border-color .18s;
}
.woocommerce .button:hover,
.woocommerce button.button:hover,
.woocommerce a.button:hover,
.woocommerce input.button:hover,
.wc-block-components-button:not(.is-link):hover {
    border-color: var(--g2-deep);
    background: var(--g2-deep);
    color: #fff;
}
.woocommerce .button.alt,
.woocommerce button.button.alt,
.woocommerce a.button.alt,
.woocommerce input.button.alt { background: var(--g2-green); border-color: var(--g2-green); color: #fff; }
.woocommerce .button.alt:hover,
.woocommerce button.button.alt:hover,
.woocommerce a.button.alt:hover,
.woocommerce input.button.alt:hover { background: var(--g2-deep); border-color: var(--g2-deep); }
.woocommerce input.input-text,
.woocommerce select,
.woocommerce textarea,
.wc-block-components-text-input input,
.wc-block-components-combobox-control input {
    background: #fff;
    border: 1px solid #C7D5C8;
    border-radius: 7px;
    color: var(--g2-ink);
    box-shadow: none;
}
.woocommerce input.input-text:focus,
.woocommerce select:focus,
.woocommerce textarea:focus,
.wc-block-components-text-input input:focus,
.wc-block-components-combobox-control input:focus { border-color: #4F8763; }
.woocommerce-message,
.woocommerce-info,
.woocommerce-error,
.woocommerce-notices-wrapper .woocommerce-message,
.woocommerce-notices-wrapper .woocommerce-info {
    border: 1px solid #D0DFCF;
    background: #EDF4EA;
    color: var(--g2-deep);
    border-radius: 9px;
    box-shadow: none;
    padding: 17px 20px;
}
.woocommerce-error { border-color: #E6C4B7; background: #FFF3EE; color: #823F2D; }
.woocommerce-message a, .woocommerce-info a { color: var(--g2-deep); }
.wc-block-components-notice-banner.is-info,
.wc-block-components-notice-banner.is-success {
    border: 1px solid #D0DFCF !important;
    border-radius: 9px;
    background: #EDF4EA !important;
    color: var(--g2-deep) !important;
}
.wc-block-components-notice-banner.is-error {
    border: 1px solid #E6C4B7 !important;
    border-radius: 9px;
    background: #FFF3EE !important;
    color: #823F2D !important;
}
.wc-block-components-notice-banner > svg { fill: var(--g2-green); }
.wc-block-components-notice-banner.is-error > svg { fill: #A64F3A; }

/* Product catalogue and related recommendations — consistent, quiet cards. */
.woocommerce-products-header { margin-bottom: 25px; }
.woocommerce-products-header__title,
.woocommerce .page-title { font-size: clamp(32px, 3vw, 44px); margin: 0 0 10px; }
.woocommerce-result-count, .woocommerce-ordering { color: var(--g2-muted); font-size: 13px; }
.woocommerce ul.products li.product,
ul.products li.product {
    background: var(--g2-paper);
    border: 1px solid #E1E5DD;
    border-radius: 12px;
    padding: clamp(14px, 1.6vw, 22px);
    box-shadow: none;
    transition: box-shadow .18s, border-color .18s;
}
.woocommerce ul.products li.product:hover,
ul.products li.product:hover { border-color: #B9CAB9; box-shadow: 0 12px 28px rgba(29,59,46,.07); }
.woocommerce ul.products li.product img,
ul.products li.product img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    object-fit: contain;
    background: #F0F2EB;
    border: 1px solid #E9ECE4;
    border-radius: 9px;
    padding: 10px;
}
.woocommerce ul.products li.product .woocommerce-loop-product__title,
ul.products li.product .woocommerce-loop-product__title { font-size: 18px; line-height: 1.4; margin: 12px 0 7px; }
.woocommerce ul.products li.product .price,
ul.products li.product .price { font-size: 17px; font-weight: 750; margin: 0 0 17px; color: var(--g2-green-mid); }
.woocommerce ul.products li.product .button,
ul.products li.product .button { margin-top: 5px; padding: 10px 15px; }

/* Single product: balanced media/details, fewer blank bands, more intentional typography. */
body.single-product div.product { color: var(--g2-ink); }
body.single-product div.product .woocommerce-product-gallery {
    width: 44%;
    margin: 0 5% 36px 0;
    float: left;
}
body.single-product div.product .summary,
body.single-product div.product .entry-summary {
    width: 51%;
    float: right;
    margin: 0 0 36px;
}
body.single-product .woocommerce-product-gallery__wrapper,
body.single-product .woocommerce-product-gallery__image { width: 100%; }
body.single-product .woocommerce-product-gallery__image img,
body.single-product .woocommerce-product-gallery__wrapper > div > a > img {
    display: block;
    width: 100%;
    height: auto;
    max-width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    padding: clamp(15px, 2vw, 32px);
    background: #F1F2EC;
    border: 1px solid #E1E6DD;
    border-radius: 13px;
}
body.single-product .woocommerce-product-gallery .flex-control-thumbs img { padding: 4px; aspect-ratio: 1 / 1; object-fit: contain; border-radius: 6px; }
body.single-product div.product .product_title,
body.single-product .entry-summary .product_title {
    margin: 0 0 17px;
    font-size: clamp(30px, 3.2vw, 47px);
    line-height: 1.14;
    font-weight: 750;
    letter-spacing: -.045em;
    color: var(--g2-deep);
}
body.single-product .summary > .price,
body.single-product .summary > p.price {
    margin: 0 0 24px;
    color: var(--g2-green-mid);
    font-size: clamp(22px, 2.1vw, 29px);
    font-weight: 750;
}
body.single-product .woocommerce-product-details__short-description {
    max-width: 65ch;
    margin: 0 0 25px;
    font-size: 15px;
    line-height: 1.8;
    color: #526359;
}
body.single-product .woocommerce-product-details__short-description p:last-child { margin-bottom: 0; }
body.single-product div.product form.cart { margin: 0 0 26px; }
body.single-product div.product form.cart .quantity { margin-right: 12px; }
body.single-product div.product .quantity .qty { width: 80px; min-height: 43px; padding: 8px; text-align: center; }
body.single-product div.product .single_add_to_cart_button { min-height: 44px; padding: 11px 24px; }
body.single-product .product_meta {
    padding-top: 21px;
    border-top: 1px solid #E2E5DD;
    color: var(--g2-muted);
    font-size: 13px;
}
body.single-product .product_meta > span { display: block; margin: 3px 0; }
body.single-product div.product .woocommerce-tabs,
body.single-product div.product .related,
body.single-product div.product .upsells { clear: both; width: 100%; }

/* Tabs across the top of the description/reviews, not a huge empty sidebar. */
body.single-product div.product .woocommerce-tabs {
    padding-top: 6px;
    margin-top: 14px;
    margin-bottom: 40px;
}
body.single-product div.product .woocommerce-tabs ul.tabs {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 8px;
    width: 100%;
    float: none;
    padding: 0 0 12px;
    margin: 0 0 20px;
    border-bottom: 1px solid #DDE3DA;
    list-style: none;
}
body.single-product div.product .woocommerce-tabs ul.tabs::before,
body.single-product div.product .woocommerce-tabs ul.tabs::after { display: none; content: none; }
body.single-product div.product .woocommerce-tabs ul.tabs li {
    display: inline-flex;
    float: none;
    border: 0;
    border-radius: 7px;
    padding: 0;
    margin: 0;
    background: transparent;
}
body.single-product div.product .woocommerce-tabs ul.tabs li::before,
body.single-product div.product .woocommerce-tabs ul.tabs li::after { display: none; content: none; }
body.single-product div.product .woocommerce-tabs ul.tabs li a {
    display: block;
    padding: 10px 18px;
    border: 1px solid transparent;
    border-radius: 7px;
    background: transparent;
    color: var(--g2-green);
    font-size: 14px;
    font-weight: 650;
    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 {
    border-color: #B9CEBC;
    background: #E6EEE3;
    color: var(--g2-deep);
}
body.single-product div.product .woocommerce-tabs .panel {
    width: 100%;
    float: none;
    padding: clamp(20px, 3vw, 32px);
    border: 1px solid #E1E5DD;
    background: #fff;
    border-radius: 12px;
    margin: 0 0 25px;
}
body.single-product div.product .woocommerce-tabs .panel h2 { font-size: clamp(22px, 2vw, 27px); margin: 0 0 19px; }
body.single-product div.product .woocommerce-tabs .panel > :last-child { margin-bottom: 0; }
body.single-product #reviews #comments,
body.single-product #reviews #review_form_wrapper { width: 100%; float: none; margin: 0 0 28px; }
body.single-product #reviews #review_form_wrapper { max-width: 760px; }
body.single-product #reviews #commentform textarea { width: 100%; min-height: 115px; }
body.single-product #reviews .comment-form-rating { margin-bottom: 16px; }
body.single-product #reviews .star-rating,
body.single-product #reviews .stars a { color: var(--g2-green); }
body.single-product section.related > h2,
body.single-product section.upsells > h2 { font-size: clamp(25px, 2.5vw, 33px); margin-bottom: 23px; }

/* Cart and checkout: both classic shortcodes and modern block components. */
body.woocommerce-cart .entry-title,
body.woocommerce-checkout .entry-title { font-size: clamp(30px, 3vw, 42px); }
body.woocommerce-cart .woocommerce-cart-form,
body.woocommerce-cart .cart-collaterals,
body.woocommerce-checkout form.checkout,
body.woocommerce-checkout .woocommerce-order {
    background: #fff;
    border: 1px solid #E2E6DD;
    border-radius: 12px;
    padding: clamp(17px, 2.5vw, 30px);
}
.woocommerce table.shop_table,
.woocommerce table.cart,
.woocommerce-checkout-review-order-table { border-collapse: separate; border-spacing: 0; border: 1px solid #E2E6DD; border-radius: 9px; overflow: hidden; background: #fff; }
.woocommerce table.shop_table th,
.woocommerce table.cart th { background: #EFF2EB; color: var(--g2-deep); }
.woocommerce table.shop_table td,
.woocommerce table.shop_table th { border-color: #E7EBE3; }
.woocommerce-cart .cart_totals,
.woocommerce-checkout #order_review { background: #fff; }
.wc-block-cart .wc-block-cart-items,
.wc-block-components-sidebar-layout .wc-block-components-sidebar,
.wc-block-checkout__main .wc-block-components-checkout-step {
    border-color: #DDE5DB;
}
.wc-block-components-sidebar-layout .wc-block-components-sidebar,
.wc-block-checkout__main .wc-block-components-checkout-step {
    border-radius: 11px;
    background: #fff;
}
.wc-block-components-totals-wrapper,
.wc-block-components-order-summary,
.wc-block-components-panel { border-color: #E2E6DD !important; }
.wc-block-components-order-summary-item__description .wc-block-components-product-name,
.wc-block-cart-item__product .wc-block-components-product-name { color: var(--g2-deep); font-weight: 700; }
.wc-block-components-totals-footer-item .wc-block-components-totals-item__value { color: var(--g2-deep); }

@media (max-width: 850px) {
    body.single-product div.product .woocommerce-product-gallery,
    body.single-product div.product .summary,
    body.single-product div.product .entry-summary {
        width: 100%;
        float: none;
        margin: 0 0 27px;
    }
    body.single-product .woocommerce-product-gallery__image img { max-height: 530px; }
    body.single-product div.product .woocommerce-tabs ul.tabs { gap: 4px; }
}
@media (max-width: 600px) {
    body.single-product .storefront-breadcrumb .col-full,
    body.post-type-archive-product .storefront-breadcrumb .col-full,
    body.tax-product_cat .storefront-breadcrumb .col-full { width: calc(100% - 36px); }
    body.single-product div.product .woocommerce-tabs .panel { padding: 18px; }
    body.single-product div.product .woocommerce-tabs ul.tabs li a { padding: 9px 13px; }
    body.single-product div.product .product_title { font-size: clamp(27px, 8vw, 34px); }
    body.woocommerce-cart .woocommerce-cart-form,
    body.woocommerce-cart .cart-collaterals,
    body.woocommerce-checkout form.checkout { padding: 14px; }
    .woocommerce ul.products li.product, ul.products li.product { padding: 12px; }
}
@media (prefers-reduced-motion: reduce) {
    .woocommerce ul.products li.product, ul.products li.product,
    .woocommerce .button, .wc-block-components-button { transition: none; }
}
