/**
 * WLD Custom Component Styles
 *
 * Supplemental overrides for WooCommerce and Storefront components.
 *
 * @package WLD_Storefront_Child
 */

/* ==========================================================================
   1. Product Image Hover Effects
   ========================================================================== */

.woocommerce ul.products li.product a img {
    overflow: hidden;
}

.woocommerce ul.products li.product .attachment-woocommerce_thumbnail {
    transition: transform 0.4s ease, box-shadow 0.3s ease;
}

.woocommerce ul.products li.product:hover .attachment-woocommerce_thumbnail {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

/* Image container overflow */
.woocommerce ul.products li.product > a {
    overflow: hidden;
    display: block;
    border-radius: var(--wld-radius-lg) var(--wld-radius-lg) 0 0;
}

/* ==========================================================================
   2. WooCommerce Result Count & Ordering
   ========================================================================== */

.woocommerce .woocommerce-result-count {
    color: var(--wld-muted);
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
}

.woocommerce .woocommerce-ordering select {
    background-color: var(--wld-surface);
    border: 1px solid var(--wld-border);
    border-radius: var(--wld-radius);
    color: var(--wld-text);
    padding: 0.5rem 2.5rem 0.5rem 0.75rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.woocommerce .woocommerce-ordering select:hover,
.woocommerce .woocommerce-ordering select:focus {
    border-color: var(--wld-primary);
    outline: none;
}

/* ==========================================================================
   3. Star Ratings
   ========================================================================== */

.woocommerce .star-rating {
    color: #F59E0B;
}

.woocommerce .star-rating span::before {
    color: #F59E0B;
}

.woocommerce p.stars a {
    color: #F59E0B;
}

.woocommerce p.stars a::before {
    color: var(--wld-border);
}

.woocommerce p.stars a:hover ~ a::before {
    color: var(--wld-border);
}

.woocommerce p.stars.selected a.active ~ a::before {
    color: var(--wld-border);
}

/* ==========================================================================
   4. Breadcrumbs
   ========================================================================== */

.woocommerce .woocommerce-breadcrumb {
    color: var(--wld-muted);
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    padding: 1rem 0;
    margin-bottom: 1rem;
}

.woocommerce .woocommerce-breadcrumb a {
    color: var(--wld-muted);
    text-decoration: none;
    transition: color 0.2s ease;
}

.woocommerce .woocommerce-breadcrumb a:hover {
    color: var(--wld-primary);
}

.storefront-breadcrumb {
    background-color: transparent;
    border-bottom: 1px solid var(--wld-border);
    margin-bottom: 2rem;
    padding: 0;
}

.storefront-breadcrumb .col-full {
    padding-top: 0;
    padding-bottom: 0;
}

/* ==========================================================================
   5. Single Product Page
   ========================================================================== */

.single-product div.product div.images {
    background-color: var(--wld-surface);
    border-radius: var(--wld-radius-lg);
    padding: 1rem;
    border: 1px solid var(--wld-border);
}

.single-product div.product div.images img {
    border-radius: var(--wld-radius);
}

.single-product div.product div.summary {
    color: var(--wld-text);
}

.single-product div.product div.summary .product_meta {
    color: var(--wld-muted);
    border-top: 1px solid var(--wld-border);
    padding-top: 1rem;
}

.single-product div.product div.summary .product_meta a {
    color: var(--wld-primary);
}

.single-product div.product div.summary .product_meta a:hover {
    color: var(--wld-primary-hover);
}

/* Variations */
.single-product .variations td,
.single-product .variations th {
    background-color: transparent;
    border: none;
    color: var(--wld-text);
}

.single-product .variations select {
    background-color: var(--wld-surface);
    border-color: var(--wld-border);
    color: var(--wld-text);
}

.single-product .reset_variations {
    color: var(--wld-muted);
}

/* Gallery thumbnails */
.single-product .flex-control-thumbs li img {
    border-radius: var(--wld-radius);
    border: 2px solid transparent;
    transition: border-color 0.2s ease;
}

.single-product .flex-control-thumbs li img:hover,
.single-product .flex-control-thumbs li img.flex-active {
    border-color: var(--wld-primary);
}

/* ==========================================================================
   6. Cart Page
   ========================================================================== */

.woocommerce-cart table.cart img {
    border-radius: var(--wld-radius);
}

.woocommerce-cart table.cart .product-name a {
    color: var(--wld-text);
    font-family: 'Roboto Condensed', sans-serif;
    font-weight: 600;
}

.woocommerce-cart table.cart .product-name a:hover {
    color: var(--wld-primary);
}

.woocommerce-cart table.cart .product-price,
.woocommerce-cart table.cart .product-subtotal {
    color: var(--wld-text);
    font-family: 'Roboto Condensed', sans-serif;
    font-weight: 600;
}

/* Cross-sells */
.woocommerce-cart .cross-sells {
    background-color: transparent;
}

.woocommerce-cart .cross-sells h2 {
    color: var(--wld-text);
}

/* ==========================================================================
   7. Checkout Page
   ========================================================================== */

.woocommerce-checkout .woocommerce-billing-fields h3,
.woocommerce-checkout .woocommerce-shipping-fields h3,
.woocommerce-checkout .woocommerce-additional-fields h3,
.woocommerce-checkout h3#order_review_heading {
    color: var(--wld-text);
    font-family: 'Bebas Neue', sans-serif;
    letter-spacing: 0.15em;
}

.woocommerce-checkout .form-row label {
    color: var(--wld-text);
}

.woocommerce-checkout .select2-container--default .select2-selection--single {
    background-color: var(--wld-surface);
    border-color: var(--wld-border);
    color: var(--wld-text);
    height: auto;
    padding: 0.5rem;
}

.woocommerce-checkout .select2-container--default .select2-selection--single .select2-selection__rendered {
    color: var(--wld-text);
}

.select2-dropdown {
    background-color: var(--wld-surface);
    border-color: var(--wld-border);
}

.select2-results__option {
    color: var(--wld-text);
}

.select2-container--default .select2-results__option--highlighted[aria-selected],
.select2-container--default .select2-results__option--highlighted[data-selected] {
    background-color: var(--wld-primary);
    color: #ffffff;
}

/* ==========================================================================
   8. My Account Page
   ========================================================================== */

.woocommerce-account .woocommerce-MyAccount-content table {
    background-color: var(--wld-surface);
    color: var(--wld-text);
}

.woocommerce-account .woocommerce-MyAccount-content table th {
    background-color: rgba(38, 38, 38, 0.8);
}

.woocommerce-account .woocommerce-MyAccount-content h2,
.woocommerce-account .woocommerce-MyAccount-content h3 {
    color: var(--wld-text);
}

.woocommerce-account .addresses .title h3 {
    color: var(--wld-text);
}

.woocommerce-account .addresses .title .edit {
    color: var(--wld-primary);
}

.woocommerce-account .woocommerce-orders-table__cell-order-actions a {
    background-color: var(--wld-primary);
    color: #ffffff;
}

/* ==========================================================================
   9. Sale Flash Badge
   ========================================================================== */

.woocommerce span.onsale {
    background-color: var(--wld-primary);
    color: #ffffff;
    font-family: 'Roboto Condensed', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    border-radius: var(--wld-radius);
    padding: 0.25rem 0.75rem;
    min-height: auto;
    min-width: auto;
    line-height: 1.6;
}

/* On single product */
.single-product .woocommerce span.onsale {
    font-size: 0.85rem;
    padding: 0.35rem 1rem;
}

/* ==========================================================================
   10. Quantity Input
   ========================================================================== */

.woocommerce .quantity {
    display: inline-flex;
    align-items: center;
}

.woocommerce .quantity .qty {
    background-color: var(--wld-surface);
    border: 1px solid var(--wld-border);
    border-radius: var(--wld-radius);
    color: var(--wld-text);
    width: 60px;
    text-align: center;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    padding: 0.5rem;
    -moz-appearance: textfield;
}

.woocommerce .quantity .qty::-webkit-inner-spin-button,
.woocommerce .quantity .qty::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.woocommerce .quantity .qty:focus {
    border-color: var(--wld-primary);
    box-shadow: 0 0 0 2px var(--wld-primary-glow);
    outline: none;
}

/* ==========================================================================
   11. Pagination
   ========================================================================== */

.woocommerce nav.woocommerce-pagination {
    margin-top: 2rem;
}

.woocommerce nav.woocommerce-pagination ul {
    border: 1px solid var(--wld-border);
    border-radius: var(--wld-radius);
    overflow: hidden;
}

.woocommerce nav.woocommerce-pagination ul li {
    border-right: 1px solid var(--wld-border);
}

.woocommerce nav.woocommerce-pagination ul li:last-child {
    border-right: none;
}

.woocommerce nav.woocommerce-pagination ul li a,
.woocommerce nav.woocommerce-pagination ul li span {
    background-color: var(--wld-surface);
    color: var(--wld-muted);
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: all 0.2s ease;
}

.woocommerce nav.woocommerce-pagination ul li a:hover {
    background-color: var(--wld-primary);
    color: #ffffff;
}

.woocommerce nav.woocommerce-pagination ul li span.current {
    background-color: var(--wld-primary);
    color: #ffffff;
    font-weight: 700;
}

/* Post pagination */
.navigation.post-navigation .nav-links a,
.navigation.posts-navigation .nav-links a {
    color: var(--wld-text);
    font-family: 'Roboto Condensed', sans-serif;
    font-weight: 600;
}

.navigation.post-navigation .nav-links a:hover,
.navigation.posts-navigation .nav-links a:hover {
    color: var(--wld-primary);
}

/* ==========================================================================
   12. Widget Overrides
   ========================================================================== */

.widget_price_filter .ui-slider {
    background-color: var(--wld-border);
}

.widget_price_filter .ui-slider .ui-slider-range {
    background-color: var(--wld-primary);
}

.widget_price_filter .ui-slider .ui-slider-handle {
    background-color: var(--wld-primary);
    border-color: var(--wld-primary);
}

.widget_price_filter .price_slider_amount .price_label {
    color: var(--wld-text);
}

.widget_layered_nav ul li a,
.widget_product_categories ul li a {
    color: var(--wld-muted);
}

.widget_layered_nav ul li a:hover,
.widget_product_categories ul li a:hover {
    color: var(--wld-text);
}

.widget_layered_nav ul li .count,
.widget_product_categories ul li .count {
    color: var(--wld-muted);
    background-color: rgba(38, 38, 38, 0.5);
    border-radius: 3px;
    padding: 0 0.3rem;
}

/* ==========================================================================
   13. Coupon Code
   ========================================================================== */

.woocommerce .woocommerce-form-coupon-toggle .woocommerce-info {
    background-color: var(--wld-surface);
    border-top-color: var(--wld-primary);
    color: var(--wld-text);
}

.woocommerce form.checkout_coupon {
    background-color: var(--wld-surface);
    border-color: var(--wld-border);
}

/* ==========================================================================
   14. Empty Cart / No Products
   ========================================================================== */

.woocommerce-cart .cart-empty,
.woocommerce-cart .return-to-shop {
    text-align: center;
}

.woocommerce .woocommerce-info {
    background-color: var(--wld-surface);
    border-top-color: var(--wld-primary);
    color: var(--wld-text);
}

.woocommerce .woocommerce-info::before {
    color: var(--wld-primary);
}

/* ==========================================================================
   15. Storefront Handheld Footer Bar
   ========================================================================== */

.storefront-handheld-footer-bar {
    background-color: var(--wld-surface);
    border-top: 1px solid var(--wld-border);
}

.storefront-handheld-footer-bar ul li > a {
    color: var(--wld-text);
}

.storefront-handheld-footer-bar ul li.cart .count {
    background-color: var(--wld-primary);
    color: #ffffff;
    border-color: var(--wld-surface);
}

/* ==========================================================================
   16. Scrollbar Styling
   ========================================================================== */

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--wld-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--wld-border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--wld-muted);
}

/* ==========================================================================
   17. Miscellaneous
   ========================================================================== */

/* Storefront sorting wrapper */
.storefront-sorting {
    border-bottom-color: var(--wld-border);
    padding-bottom: 1rem;
    margin-bottom: 2rem;
}

/* Related / upsell headings */
section.related.products,
section.upsells.products {
    border-top: 1px solid var(--wld-border);
    padding-top: 2rem;
    margin-top: 2rem;
}

/* Loading spinner */
.woocommerce .blockUI.blockOverlay::before {
    border-color: var(--wld-primary) transparent transparent;
}

/* Review form */
#review_form #respond .comment-form-rating label {
    color: var(--wld-text);
}

#review_form #respond .form-submit input[type="submit"] {
    background-color: var(--wld-primary);
    color: #ffffff;
}

/* Comments */
.woocommerce #reviews #comments ol.commentlist li .comment-text {
    background-color: var(--wld-surface);
    border-color: var(--wld-border);
    border-radius: var(--wld-radius);
}

.woocommerce #reviews #comments ol.commentlist li .comment-text p.meta {
    color: var(--wld-muted);
}

/* Product search widget */
.woocommerce-product-search input[type="search"] {
    background-color: var(--wld-surface);
    border-color: var(--wld-border);
    color: var(--wld-text);
}

.woocommerce-product-search button[type="submit"] {
    background-color: var(--wld-primary);
    color: #ffffff;
}

.wld-header-search .woocommerce-product-search input[type="search"],
.wld-hero-search .woocommerce-product-search input[type="search"] {
    background-color: var(--wld-panel);
    border-color: var(--wld-border);
    color: var(--wld-text);
}

.wld-header-search .woocommerce-product-search button[type="submit"],
.wld-hero-search .woocommerce-product-search button[type="submit"] {
    background-color: var(--wld-primary);
    color: #ffffff;
}
