/* ===================================================
   Bokther Shop Designer — Public Shop CSS
   ================================================= */

/* ---- Light theme (default) ---- */
:root,
[data-bsd-theme="light"] {
    --bsd-bg:          #f8fafc;
    --bsd-surface:     #ffffff;
    --bsd-surface-2:   #f1f5f9;
    --bsd-border:      #e2e8f0;
    --bsd-text:        #0f172a;
    --bsd-text-2:      #475569;
    --bsd-text-3:      #94a3b8;
    --bsd-overlay:     rgba(255,255,255,.9);
    --bsd-price-del:   #94a3b8;
}

/* ---- Dark theme ---- */
[data-bsd-theme="dark"] {
    --bsd-bg:          #0d1117;
    --bsd-surface:     #161b22;
    --bsd-surface-2:   #21262d;
    --bsd-border:      #30363d;
    --bsd-text:        #e6edf3;
    --bsd-text-2:      #8b949e;
    --bsd-text-3:      #484f58;
    --bsd-overlay:     rgba(22,27,34,.95);
    --bsd-price-del:   #6e7681;
}

/* ---- System auto dark mode ---- */
@media (prefers-color-scheme: dark) {
    [data-bsd-theme="auto"] {
        --bsd-bg:          #0d1117;
        --bsd-surface:     #161b22;
        --bsd-surface-2:   #21262d;
        --bsd-border:      #30363d;
        --bsd-text:        #e6edf3;
        --bsd-text-2:      #8b949e;
        --bsd-text-3:      #484f58;
        --bsd-overlay:     rgba(22,27,34,.95);
        --bsd-price-del:   #6e7681;
    }
}

/* ================================================== */
/* Base / Reset                                       */
/* ================================================== */
.bsd-shop-wrap {
    background: var(--bsd-bg);
    font-family: 'DM Sans', var(--bsd-font), sans-serif;
    min-height: 100vh;
    transition: background .35s, color .35s;
    padding-bottom: 60px;
}

.bsd-shop-wrap *,
.bsd-shop-wrap *::before,
.bsd-shop-wrap *::after {
    box-sizing: border-box;
    transition: background .3s, color .3s, border-color .3s;
}

/* ================================================== */
/* Dark Mode Toggle Button                            */
/* ================================================== */
#bsd-dark-toggle {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 9999;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: var(--bsd-surface);
    border: 2px solid var(--bsd-border);
    box-shadow: 0 4px 24px rgba(0,0,0,.18);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    transition: transform .25s, box-shadow .25s;
}

#bsd-dark-toggle:hover {
    transform: scale(1.12) rotate(20deg);
    box-shadow: 0 8px 32px rgba(0,0,0,.25);
}

[data-bsd-theme="light"] #bsd-dark-toggle .bsd-icon-sun,
[data-bsd-theme="auto"]  #bsd-dark-toggle .bsd-icon-sun  { display: block; }
[data-bsd-theme="light"] #bsd-dark-toggle .bsd-icon-moon,
[data-bsd-theme="auto"]  #bsd-dark-toggle .bsd-icon-moon { display: none; }
[data-bsd-theme="dark"]  #bsd-dark-toggle .bsd-icon-sun  { display: none; }
[data-bsd-theme="dark"]  #bsd-dark-toggle .bsd-icon-moon { display: block; }

/* ================================================== */
/* Breadcrumb                                         */
/* ================================================== */
.bsd-shop-wrap .woocommerce-breadcrumb {
    padding: 18px 0 0;
    font-size: 13px;
    color: var(--bsd-text-3);
}

.bsd-shop-wrap .woocommerce-breadcrumb a {
    color: var(--bsd-text-2);
    text-decoration: none;
}

.bsd-shop-wrap .woocommerce-breadcrumb a:hover {
    color: var(--bsd-accent);
}

/* ================================================== */
/* Page Header                                        */
/* ================================================== */
.bsd-shop-wrap .woocommerce-products-header {
    padding: 24px 0 32px;
    text-align: center;
}

.bsd-shop-wrap .woocommerce-products-header__title {
    font-family: var(--bsd-font);
    font-size: clamp(28px, 5vw, 48px);
    font-weight: 700;
    color: var(--bsd-text);
    margin: 0 0 8px;
    letter-spacing: -.02em;
}

/* ================================================== */
/* Toolbar (count + sorting)                          */
/* ================================================== */
.bsd-shop-wrap .woocommerce-result-count {
    font-size: 13px;
    color: var(--bsd-text-2);
    margin-bottom: 0;
}

.bsd-shop-wrap .woocommerce-ordering {
    margin-bottom: 0;
}

.bsd-shop-wrap .woocommerce-ordering select.orderby {
    background: var(--bsd-surface);
    border: 1.5px solid var(--bsd-border);
    color: var(--bsd-text);
    border-radius: 10px;
    padding: 8px 36px 8px 14px;
    font-size: 13px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4' stroke='%2394a3b8' fill='none' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
    cursor: pointer;
    outline: none;
}

.bsd-shop-wrap .woocommerce-ordering select.orderby:focus {
    border-color: var(--bsd-accent);
}

/* ================================================== */
/* Product Grid                                       */
/* ================================================== */
.bsd-shop-wrap ul.products {
    display: grid !important;
    grid-template-columns: repeat(var(--bsd-cols, 3), 1fr) !important;
    gap: var(--bsd-gap, 28px) !important;
    list-style: none !important;
    padding: 0 !important;
    margin: 32px 0 !important;
    float: none !important;
    clear: both;
}

@media (max-width: 900px) {
    .bsd-shop-wrap ul.products {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}
@media (max-width: 560px) {
    .bsd-shop-wrap ul.products {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }
}

/* ================================================== */
/* Product Card                                       */
/* ================================================== */
.bsd-shop-wrap ul.products li.product {
    background: var(--bsd-surface);
    border-radius: var(--bsd-radius, 16px);
    overflow: hidden;
    border: 1.5px solid var(--bsd-border);
    box-shadow: var(--bsd-shadow, 0 4px 24px rgba(0,0,0,.10));
    position: relative;
    display: flex;
    flex-direction: column;
    transition: transform .3s cubic-bezier(.34,1.56,.64,1),
                box-shadow .3s ease,
                border-color .3s;
    width: 100% !important;
    float: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Hover - Lift */
.bsd-hover-lift ul.products li.product:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 60px rgba(0,0,0,.18);
    border-color: var(--bsd-accent);
}

/* Hover - Glow */
.bsd-hover-glow ul.products li.product:hover {
    box-shadow: 0 0 0 3px var(--bsd-accent), 0 12px 40px rgba(0,0,0,.15);
}

/* Hover - Flip (subtle) */
.bsd-hover-flip ul.products li.product { perspective: 1000px; }
.bsd-hover-flip ul.products li.product:hover { transform: rotateY(2deg) translateY(-6px); }

/* ---- Product image wrapper ---- */
.bsd-shop-wrap ul.products li.product a.woocommerce-loop-product__link {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    flex: 1;
}

.bsd-shop-wrap ul.products li.product img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
    transition: transform .5s cubic-bezier(.25,.46,.45,.94);
}

.bsd-shop-wrap ul.products li.product:hover img {
    transform: scale(1.06);
}

/* Image overflow clip */
.bsd-shop-wrap ul.products li.product a.woocommerce-loop-product__link > img {
    border-radius: 0;
}

/* ---- Sale badge ---- */
.bsd-shop-wrap ul.products li.product .onsale {
    position: absolute;
    top: 14px;
    left: 14px;
    background: var(--bsd-accent);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    padding: 4px 10px;
    border-radius: 9999px;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(0,0,0,.2);
}

/* ---- Product body (title + price) ---- */
.bsd-shop-wrap ul.products li.product h2.woocommerce-loop-product__title {
    font-family: var(--bsd-font);
    font-size: 16px;
    font-weight: 600;
    color: var(--bsd-text);
    margin: 0;
    padding: 16px 18px 6px;
    line-height: 1.4;
}

.bsd-shop-wrap ul.products li.product .price {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 18px 16px;
    font-size: 15px;
    font-weight: 700;
    color: var(--bsd-accent);
}

.bsd-shop-wrap ul.products li.product .price del {
    font-size: 12px;
    font-weight: 400;
    color: var(--bsd-price-del);
    text-decoration: line-through;
}

.bsd-shop-wrap ul.products li.product .price ins {
    text-decoration: none;
}

/* ---- Star rating ---- */
.bsd-shop-wrap ul.products li.product .star-rating {
    padding: 0 18px 10px;
    font-size: 12px;
    color: #f59e0b;
}

/* ---- Add to cart button ---- */
.bsd-shop-wrap ul.products li.product .button.add_to_cart_button {
    display: block;
    margin: 0 16px 16px;
    padding: 12px 20px;
    background: var(--bsd-accent);
    color: #fff !important;
    text-align: center;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    border-radius: var(--bsd-btn-radius, 9999px);
    border: none;
    cursor: pointer;
    transition: background .2s, transform .15s, box-shadow .2s;
    letter-spacing: .03em;
    text-transform: uppercase;
    font-family: 'DM Sans', sans-serif;
    box-shadow: 0 2px 12px color-mix(in srgb, var(--bsd-accent) 35%, transparent);
}

.bsd-shop-wrap ul.products li.product .button.add_to_cart_button:hover {
    background: var(--bsd-accent-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 20px color-mix(in srgb, var(--bsd-accent) 45%, transparent);
}

.bsd-shop-wrap ul.products li.product .button.add_to_cart_button:active {
    transform: scale(.97);
}

/* Outline button variant */
.bsd-btn-outline .bsd-shop-wrap ul.products li.product .button.add_to_cart_button {
    background: transparent;
    color: var(--bsd-accent) !important;
    border: 2px solid var(--bsd-accent);
}

.bsd-btn-outline .bsd-shop-wrap ul.products li.product .button.add_to_cart_button:hover {
    background: var(--bsd-accent);
    color: #fff !important;
}

/* Added to cart state */
.bsd-shop-wrap ul.products li.product .button.added::after {
    content: ' ✓';
    opacity: .8;
}

/* ================================================== */
/* Pagination                                         */
/* ================================================== */
.bsd-shop-wrap .woocommerce-pagination {
    display: flex;
    justify-content: center;
    margin-top: 48px;
}

.bsd-shop-wrap .woocommerce-pagination ul.page-numbers {
    display: flex;
    align-items: center;
    gap: 6px;
    list-style: none;
    padding: 0;
    margin: 0;
    background: var(--bsd-surface);
    border: 1.5px solid var(--bsd-border);
    border-radius: 14px;
    padding: 8px;
    box-shadow: 0 2px 12px rgba(0,0,0,.06);
}

.bsd-shop-wrap .woocommerce-pagination ul.page-numbers li {
    display: flex;
}

.bsd-shop-wrap .woocommerce-pagination ul.page-numbers li a.page-numbers,
.bsd-shop-wrap .woocommerce-pagination ul.page-numbers li span.page-numbers {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    border-radius: 9px;
    font-size: 14px;
    font-weight: 500;
    color: var(--bsd-text-2);
    text-decoration: none;
    transition: background .2s, color .2s;
    padding: 0 10px;
}

.bsd-shop-wrap .woocommerce-pagination ul.page-numbers li a.page-numbers:hover {
    background: var(--bsd-surface-2);
    color: var(--bsd-text);
}

.bsd-shop-wrap .woocommerce-pagination ul.page-numbers li span.page-numbers.current {
    background: var(--bsd-accent);
    color: #fff;
    font-weight: 700;
    box-shadow: 0 2px 10px color-mix(in srgb, var(--bsd-accent) 35%, transparent);
}

.bsd-shop-wrap .woocommerce-pagination ul.page-numbers li a.page-numbers.next,
.bsd-shop-wrap .woocommerce-pagination ul.page-numbers li a.page-numbers.prev {
    font-size: 16px;
    font-weight: 700;
    background: var(--bsd-surface-2);
}

/* ================================================== */
/* Notices                                            */
/* ================================================== */
.bsd-shop-wrap .woocommerce-notices-wrapper .woocommerce-message,
.bsd-shop-wrap .woocommerce-notices-wrapper .woocommerce-info {
    background: var(--bsd-surface);
    border-top-color: var(--bsd-accent);
    color: var(--bsd-text);
    border-radius: 0 0 12px 12px;
    box-shadow: 0 4px 16px rgba(0,0,0,.08);
}

/* ================================================== */
/* Loading skeleton animation                         */
/* ================================================== */
@keyframes bsd-shimmer {
    0%   { background-position: -600px 0; }
    100% { background-position:  600px 0; }
}

/* ================================================== */
/* Responsive helpers                                 */
/* ================================================== */
@media (max-width: 768px) {
    #bsd-dark-toggle { bottom: 16px; right: 16px; width: 46px; height: 46px; font-size: 18px; }
    .bsd-shop-wrap ul.products { margin: 20px 0 !important; }
}
