/* ── Toptancım — Global Styles ── */
:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --accent: #f97316;
    --slate: #64748b;
    --slate-light: #f1f5f9;
    --border: #e2e8f0;
}

html, body {
    overflow-x: hidden;
}

/* ── Product Card ── */
.product-card {
    border: 1px solid var(--border);
    border-radius: .75rem;
    overflow: hidden;
    transition: box-shadow .2s, transform .2s;
    background: #fff;
}
.product-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,.1);
    transform: translateY(-2px);
}
.product-card .product-img-wrap {
    position: relative;
    padding-top: 75%; /* 4:3 ratio */
    overflow: hidden;
    background: var(--slate-light);
}
.product-card .product-img-wrap img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s;
}
.product-card:hover .product-img-wrap img { transform: scale(1.04); }

.product-card .product-body { padding: 1rem; min-width: 0; }
.product-card { min-width: 0; }
.product-card .product-sku { font-size: .72rem; color: var(--slate); }
.product-card .product-name { font-weight: 600; font-size: .95rem; line-height: 1.3; }

.product-card .wholesale-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
}
.product-card .list-price {
    font-size: .8rem;
    color: var(--slate);
    text-decoration: line-through;
}

/* ── Quantity Stepper ── */
.qty-stepper { display: flex; align-items: center; gap: .25rem; }
.qty-stepper button {
    width: 32px; height: 32px;
    border: 1px solid var(--border);
    background: #fff;
    border-radius: .375rem;
    cursor: pointer;
    font-size: 1.1rem;
    display: flex; align-items: center; justify-content: center;
    transition: background .15s;
}
.qty-stepper button:hover { background: var(--slate-light); }
.qty-stepper input {
    width: 60px;
    text-align: center;
    border: 1px solid var(--border);
    border-radius: .375rem;
    padding: .25rem .5rem;
    font-weight: 600;
}

/* ── Cart floating badge (header mobile + desktop) ── */
.cart-count-badge { font-size: .65rem; min-width: 1.2rem; line-height: 1.2rem; }

/* ── Store logo: readable on small screens, larger on md+ ── */
.store-logo { font-size: 1.15rem; }
@media (min-width: 768px) {
    .store-logo { font-size: 1.5rem; }
    .header-search.input-group-sm > .form-control,
    .header-search.input-group-sm > .btn {
        padding: .375rem .75rem;
        font-size: 1rem;
    }
}

/* ── Hero Section ── */
.hero-section {
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 60%, #0ea5e9 100%);
    color: #fff;
    padding: 4rem 0;
}

/* ── Category Badge ── */
.category-badge {
    background: var(--slate-light);
    border: 1px solid var(--border);
    border-radius: 2rem;
    padding: .35rem 1rem;
    font-size: .85rem;
    text-decoration: none;
    color: #374151;
    transition: background .15s, border-color .15s;
    display: inline-flex; align-items: center; gap: .35rem;
}
.category-badge:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ── Page breadcrumb ── */
.page-header {
    background: var(--slate-light);
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
}
.page-header .breadcrumb {
    flex-wrap: wrap;
    word-break: break-word;
}

/* ── Horizontal category nav (mobile) ── */
.category-nav-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    margin: 0;
    padding: 0 0 0.25rem;
}
.category-nav-scroll .category-nav-inner {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0;
    min-width: min-content;
}
.header-categories .category-nav-inner {
    flex-wrap: nowrap !important;
    display: inline-flex;
    min-width: max-content;
}
.category-nav-scroll .dropdown,
.category-nav-scroll > .category-nav-inner > a {
    flex-shrink: 0;
}

/* Home: wrap badges on tablet+, horizontal scroll only on narrow phones */
.category-nav-scroll.home-categories .category-nav-inner {
    flex-wrap: wrap;
}
@media (max-width: 575.98px) {
    .category-nav-scroll.home-categories .category-nav-inner {
        flex-wrap: nowrap;
    }
}

/* ── Hero (mobile) ── */
@media (max-width: 575.98px) {
    .hero-section {
        padding: 2rem 0;
    }
    .hero-section .hero-title,
    .hero-section .display-5 {
        font-size: 1.55rem;
        line-height: 1.25;
    }
    .hero-section .lead {
        font-size: 1rem;
    }
}

/* ── Cart row: stack qty / line total on narrow screens ── */
.cart-row-store .cart-row-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}
@media (max-width: 767.98px) {
    .cart-row-store .cart-row-actions {
        justify-content: space-between;
        width: 100%;
        padding-top: 0.5rem;
        margin-top: 0.25rem;
        border-top: 1px solid var(--border);
    }
}

/* ── Sticky order summary: desktop only (avoids odd overlap on mobile) ── */
@media (min-width: 992px) {
    .order-summary-sticky {
        position: sticky;
        top: 5.5rem;
    }
}

/* ── Touch: avoid heavy hover shift on phones ── */
@media (hover: none) {
    .product-card:hover {
        transform: none;
    }
    .product-card:hover .product-img-wrap img {
        transform: none;
    }
}

/* ── Tables: optional min width for admin storefront tables ── */
.table-min-600 {
    min-width: 600px;
}

/* Product detail gallery */
.product-thumb {
    border-color: var(--border);
}
.product-thumb.active-thumb {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 1px rgba(37, 99, 235, .15);
}
.product-main-image {
    cursor: zoom-in;
}
.product-modal-image {
    max-height: 80vh;
    object-fit: contain;
}

/* Home featured card gallery arrows */
.home-gallery-wrap .gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 999px;
    background: rgba(17, 24, 39, .55);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    opacity: 0;
    transition: opacity .2s;
}
.home-gallery-wrap .gallery-nav.prev { left: .4rem; }
.home-gallery-wrap .gallery-nav.next { right: .4rem; }
.home-gallery-wrap:hover .gallery-nav,
.home-gallery-wrap .gallery-nav:focus-visible {
    opacity: 1;
}
@media (hover: none) {
    .home-gallery-wrap .gallery-nav {
        opacity: .9;
    }
}
