/*
 Theme Name:   GeneratePress Child
 Theme URI:    https://generatepress.com
 Description:  Default GeneratePress child theme
 Author:       Tom Usborne
 Author URI:   https://tomusborne.com
 Template:     generatepress
 Version:      0.1
*/

/* Woocommerce */

.post-type-archive.post-type-archive-product .entry-content > :is(header,nav:not(.woocommerce-pagination)) {
    display: none;
}
	
.woocommerce-Tabs-panel > h2 {
    display: none;
}
	
.woocommerce ul.products.columns-3 li.product, .woocommerce-page ul.products.columns-3 li.product {
    width: 32%;
}
	.woocommerce ul.products li.product:not(.last), .woocommerce-page ul.products li.product:not(.last) {
		margin-right: 2%;
	}
	.woocommerce-page ul.products li.product img{
		border-radius: 12px;
	}
	.woocommerce:where(body:not(.woocommerce-block-theme-has-button-styles)) #respond input#submit, .woocommerce:where(body:not(.woocommerce-block-theme-has-button-styles)) a.button, .woocommerce:where(body:not(.woocommerce-block-theme-has-button-styles)) button.button, .woocommerce:where(body:not(.woocommerce-block-theme-has-button-styles)) input.button, :where(body:not(.woocommerce-block-theme-has-button-styles)):where(:not(.edit-post-visual-editor)) .woocommerce #respond input#submit, :where(body:not(.woocommerce-block-theme-has-button-styles)):where(:not(.edit-post-visual-editor)) .woocommerce a.button, :where(body:not(.woocommerce-block-theme-has-button-styles)):where(:not(.edit-post-visual-editor)) .woocommerce button.button, :where(body:not(.woocommerce-block-theme-has-button-styles)):where(:not(.edit-post-visual-editor)) .woocommerce input.button {
    border-radius: 8px;
}
	.woocommerce-product-gallery__image {
    border-radius: 16px;
}

.woocommerce div.product div.images .flex-control-thumbs li {
    border-radius: 12px;
    overflow: hidden;
    width: 80px;
    height: 80px;
    margin: 4px;
}

/* Container Layout */
.shop-filter-bar {
	background: white;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 40px;
    position: sticky;
    top: 0px;
	z-index: 9999;
	padding: 10px 0;
    
}

.shop-filter-bar .back-arrow {text-decoration: none;font-size: 12px;font-weight: 600; color:var(--contrast);}
.shop-filter-bar .back-arrow:is(:hover, :focus) {
    color:var(--accent) !important;
}

.shop-filter-bar .grid-container {
	display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
	padding: 0 40px;
}

.shop-filter-bar .woocommerce-ordering {
    margin: auto;
}

/* Scrollable Category Container */
.category-scroll {
    display: flex;
    align-items: center;
    gap: 32px;
    overflow-x: auto;
    white-space: nowrap;
    max-width: 65%;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

/* Hide Scrollbars for Clean Look */
.category-scroll::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

/* Category Text Links */
.category-scroll .cat-pill {
    text-decoration: none;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: #666666;
    transition: color 0.2s ease;
    flex-shrink: 0;
}

.category-scroll .cat-pill:hover,
.category-scroll .cat-pill.active {
    color: var(--accent, #c38e66);
}

/* Right-aligned Sorting Options */
.shop-sorting {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.shop-sorting select {
    border: none;
    background: transparent;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    padding-right: 15px;
}

.shop-sorting select:focus {
    outline: none;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .shop-filter-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
		padding-inline: 16px;
    }
    .category-scroll {
        max-width: 100%;
        width: 100%;
    }

	.shop-sorting	.orderby {
		max-width: 130px !important;
	}
}


.wp-singular h1.product_title.entry-title {font-size: clamp(30px,2.75vw,42px);}

.wp-singular .amount {
    color: var(--accent) !important;
    font-weight: 600;
}

.woocommerce-variation-add-to-cart.variations_button {
	display: flex;
}


button.single_add_to_cart_button.button.alt {
	background: var(--contrast) !important;
}

/* Container alignment */
.filter-controls {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Base label styling */
.shop-filter-bar .toggle-switch-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: opacity 0.3s ease;
}

/* The actual Switch Box */
.shop-filter-bar .toggle-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
    margin-right: 10px;
}

/* Hide default HTML checkbox */
.shop-filter-bar .toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

/* The slider track */
.shop-filter-bar .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
}

/* The circular slider button */
.shop-filter-bar .slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
}

/* Rounded slider look */
.shop-filter-bar .slider.round {
    border-radius: 22px;
}
.shop-filter-bar .slider.round:before {
    border-radius: 50%;
}

/* When Checked (Active color - change #000 to match your theme's primary color) */
.shop-filter-bar .toggle-switch input:checked + .slider {
    background-color: #000; 
}
.shop-filter-bar .toggle-switch input:checked + .slider:before {
    transform: translateX(18px);
}
/* hide for now */
.shop-filter-bar .stock-toggle {
	display: none;
}
/* ---- LOADING STATE STYLES ---- */
.shop-filter-bar .stock-toggle.is-loading .toggle-switch-label {
    opacity: 0.6;
    pointer-events: none; /* Prevents further clicks */
    cursor: wait;
}

.shop-filter-bar .stock-toggle.is-loading .slider {
    cursor: wait;
}

/* Loading Spinner */
.shop-filter-bar .loading-spinner {
    display: none;
    width: 14px;
    height: 14px;
    margin-left: 10px;
    border: 2px solid #ccc;
    border-top-color: #333;
    border-radius: 50%;
    animation: customSpin 1s linear infinite;
}

.shop-filter-bar .stock-toggle.is-loading .loading-spinner {
    display: inline-block;
}

@keyframes customSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}


.woocommerce .quantity .qty {
    width: 6.631em;
    text-align: center
}