/* ==========================================================================
   SIALKOTGLOVES.COM — PRODUCTION STOREFRONT STYLESHEET
   Brand Palette:
   - Charcoal Black: #17191D
   - Deep Navy:      #142B4A
   - Performance Red: #D62828
   - Clean White:    #FFFFFF
   - Light Gray:     #F4F6F8
   ========================================================================== */

:root {
    --sg-black: #17191D;
    --sg-navy: #142B4A;
    --sg-red: #D62828;
    --sg-red-hover: #b71c1c;
    --sg-white: #FFFFFF;
    --sg-gray-light: #F4F6F8;
    --sg-gray-border: #E2E8F0;
    --sg-gray-text: #64748B;
    --sg-dark: #0F172A;
    --sg-font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body {
    font-family: var(--sg-font-sans);
    color: var(--sg-dark);
    background-color: var(--sg-gray-light);
    line-height: 1.6;
    overflow-x: hidden;
}

/* --------------------------------------------------------------------------
   Typography & Common Elements
   -------------------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    color: var(--sg-black);
    letter-spacing: -0.02em;
}

.text-brand-red { color: var(--sg-red) !important; }
.bg-brand-red { background-color: var(--sg-red) !important; color: #fff; }
.text-brand-navy { color: var(--sg-navy) !important; }
.bg-brand-navy { background-color: var(--sg-navy) !important; color: #fff; }
.text-brand-black { color: var(--sg-black) !important; }
.bg-brand-black { background-color: var(--sg-black) !important; color: #fff; }

.btn-brand-red {
    background-color: var(--sg-red);
    border-color: var(--sg-red);
    color: #fff;
    font-weight: 600;
    padding: 0.65rem 1.4rem;
    border-radius: 6px;
    transition: all 0.2s ease-in-out;
}
.btn-brand-red:hover, .btn-brand-red:focus {
    background-color: var(--sg-red-hover);
    border-color: var(--sg-red-hover);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(214, 40, 40, 0.3);
}

.btn-brand-navy {
    background-color: var(--sg-navy);
    border-color: var(--sg-navy);
    color: #fff;
    font-weight: 600;
    padding: 0.65rem 1.4rem;
    border-radius: 6px;
    transition: all 0.2s ease-in-out;
}
.btn-brand-navy:hover {
    background-color: #0d1e35;
    border-color: #0d1e35;
    color: #fff;
}

.btn-brand-outline {
    background-color: transparent;
    border: 2px solid var(--sg-red);
    color: var(--sg-red);
    font-weight: 600;
    padding: 0.6rem 1.3rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}
.btn-brand-outline:hover {
    background-color: var(--sg-red);
    color: #fff;
}

/* --------------------------------------------------------------------------
   Header & Navigation
   -------------------------------------------------------------------------- */
.top-announcement-bar {
    background-color: var(--sg-black);
    color: #E2E8F0;
    font-size: 0.825rem;
    padding: 0.45rem 0;
    letter-spacing: 0.03em;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.main-header {
    background-color: #ffffff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 0;
    z-index: 1050;
}

.navbar-brand img {
    max-height: 48px;
    width: auto;
    object-fit: contain;
}

.header-search-container {
    position: relative;
    max-width: 500px;
    width: 100%;
}

.header-search-input {
    border: 2px solid var(--sg-gray-border);
    border-radius: 30px;
    padding-left: 2.75rem;
    padding-right: 1.5rem;
    height: 44px;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.header-search-input:focus {
    border-color: var(--sg-red);
    box-shadow: 0 0 0 3px rgba(214, 40, 40, 0.15);
}

.header-search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--sg-gray-text);
}

.search-results-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    z-index: 1050;
    margin-top: 6px;
    max-height: 400px;
    overflow-y: auto;
    display: none;
    border: 1px solid var(--sg-gray-border);
}

.category-nav-bar {
    background-color: var(--sg-navy);
    border-top: 1px solid rgba(255,255,255,0.08);
}

.category-nav-link {
    color: #fff;
    font-weight: 600;
    font-size: 0.88rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.75rem 1rem !important;
    transition: color 0.2s, background-color 0.2s;
}

.category-nav-link:hover, .category-nav-link:focus {
    color: #fff;
    background-color: rgba(214, 40, 40, 0.85);
}

/* --------------------------------------------------------------------------
   Product Cards
   -------------------------------------------------------------------------- */
.product-card {
    background: #fff;
    border: 1px solid var(--sg-gray-border);
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
    border-color: #cbd5e1;
}

.product-card-image-wrap {
    position: relative;
    padding-top: 100%; /* 1:1 Aspect ratio */
    background: #f8fafc;
    overflow: hidden;
}

.product-card-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.product-card:hover .product-card-image {
    transform: scale(1.05);
}

.product-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 0.35rem 0.65rem;
    border-radius: 4px;
    z-index: 2;
    letter-spacing: 0.05em;
}

.product-badge-sale {
    background-color: var(--sg-red);
    color: #fff;
}

.product-badge-bestseller {
    background-color: var(--sg-navy);
    color: #fff;
}

.product-badge-new {
    background-color: #059669;
    color: #fff;
}

.product-wishlist-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    z-index: 2;
    transition: all 0.2s;
}

.product-wishlist-btn:hover, .product-wishlist-btn.active {
    color: var(--sg-red);
    background: #fff;
    transform: scale(1.1);
}

.product-card-body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.product-category-crumb {
    font-size: 0.75rem;
    color: var(--sg-gray-text);
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.product-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--sg-black);
    text-decoration: none;
    line-height: 1.4;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-title:hover {
    color: var(--sg-red);
}

.product-rating-stars {
    color: #F59E0B;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.product-price-box {
    margin-top: auto;
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.product-quote-badge {
    background: #fff5f5 !important;
    border: 1px dashed #fca5a5 !important;
    color: var(--sg-red) !important;
    font-size: 0.76rem;
    font-weight: 600;
    padding: 0.3rem 0.5rem;
    border-radius: 6px;
    margin-top: auto;
}

.product-current-price {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--sg-red);
}

.product-old-price {
    font-size: 0.9rem;
    color: #94a3b8;
    text-decoration: line-through;
}

/* --------------------------------------------------------------------------
   Hero Carousel & Feature Sections
   -------------------------------------------------------------------------- */
.hero-carousel-item {
    position: relative;
    min-height: 480px;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(20, 43, 74, 0.95) 0%, rgba(23, 25, 29, 0.75) 50%, rgba(20, 43, 74, 0.4) 100%);
}

.hero-content {
    position: relative;
    z-index: 2;
    color: #fff;
    padding: 3rem 0;
}

.hero-tag {
    display: inline-block;
    background: var(--sg-red);
    color: #fff;
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    padding: 0.4rem 0.85rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.trust-feature-card {
    background: #fff;
    border: 1px solid var(--sg-gray-border);
    border-radius: 8px;
    padding: 1.5rem 1rem;
    text-align: center;
    transition: all 0.2s;
}

.trust-feature-card:hover {
    border-color: var(--sg-red);
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.trust-feature-icon {
    font-size: 2rem;
    color: var(--sg-red);
    margin-bottom: 0.75rem;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.main-footer {
    background-color: var(--sg-black);
    color: #94a3b8;
    padding-top: 4rem;
    padding-bottom: 2rem;
    border-top: 4px solid var(--sg-red);
}

.footer-heading {
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1.25rem;
    position: relative;
    padding-bottom: 0.5rem;
}

.footer-heading::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 32px;
    height: 2px;
    background: var(--sg-red);
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 0.65rem;
}

.footer-links a {
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: #fff;
    padding-left: 4px;
}

.footer-bottom {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.85rem;
}

/* --------------------------------------------------------------------------
   Size Selectors & Buttons
   -------------------------------------------------------------------------- */
.variant-btn-radio input[type="radio"] {
    display: none;
}

.variant-btn-label {
    display: inline-block;
    padding: 0.5rem 1rem;
    border: 2px solid var(--sg-gray-border);
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
    background: #fff;
}

.variant-btn-radio input[type="radio"]:checked + .variant-btn-label {
    border-color: var(--sg-red);
    background-color: var(--sg-red);
    color: #fff;
}

/* --------------------------------------------------------------------------
   Invoice Styles (Print-ready)
   -------------------------------------------------------------------------- */
@media print {
    body {
        background: #fff !important;
        color: #000 !important;
    }
    .no-print, .main-header, .top-announcement-bar, .main-footer, .category-nav-bar {
        display: none !important;
    }
    .printable-invoice {
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
    }
}

/* --------------------------------------------------------------------------
   Pagination Styling & SVG Icon Constraint
   -------------------------------------------------------------------------- */
nav[role="navigation"] svg,
.pagination svg {
    max-width: 1rem !important;
    max-height: 1rem !important;
    width: 16px !important;
    height: 16px !important;
    display: inline-block !important;
    vertical-align: middle;
}
.page-item.active .page-link {
    background-color: var(--sg-red) !important;
    border-color: var(--sg-red) !important;
    color: #fff !important;
}
.page-link {
    color: var(--sg-navy);
}
.page-link:hover {
    color: var(--sg-red);
}

.hover-red:hover {
    color: var(--sg-red) !important;
}

.product-merchant-box {
    background-color: #f8fafc !important;
    border-color: #e2e8f0 !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.product-merchant-box:hover {
    border-color: #cbd5e1 !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.product-merchant-crumb {
    line-height: 1.25;
}

/* Mobile 2-column Product Grid Optimization */
@media (max-width: 575.98px) {
    .product-card-body {
        padding: 0.65rem !important;
    }
    .product-title {
        font-size: 0.82rem !important;
        line-height: 1.3 !important;
        margin-bottom: 0.25rem !important;
        min-height: 2.1em;
    }
    .product-category-crumb {
        font-size: 0.65rem !important;
        margin-bottom: 0.2rem !important;
    }
    .product-badge {
        top: 6px !important;
        left: 6px !important;
        font-size: 0.58rem !important;
        padding: 0.2rem 0.35rem !important;
        letter-spacing: 0.02em !important;
    }
    .product-wishlist-btn {
        top: 6px !important;
        right: 6px !important;
        width: 28px !important;
        height: 28px !important;
        font-size: 0.8rem !important;
    }
    .product-rating-stars {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 2px !important;
        margin-bottom: 0.35rem !important;
    }
    .product-rating-stars .text-warning {
        font-size: 0.72rem !important;
    }
    .product-merchant-box {
        padding: 2px 4px !important;
        margin-bottom: 0.35rem !important;
    }
    .product-merchant-box a {
        font-size: 0.70rem !important;
    }
    .product-quote-badge {
        font-size: 0.65rem !important;
        padding: 2px 4px !important;
        margin-bottom: 0.35rem !important;
    }
    .btn-brand-red.btn-sm {
        font-size: 0.72rem !important;
        padding: 0.35rem 0.4rem !important;
    }
}

/* ==========================================================================
   ALIBABA-STYLE CATEGORY NAVIGATION: SCROLLABLE SIDEBAR & MEGA MENU WITH IMAGES
   ========================================================================== */
.alibaba-category-container {
  position: relative;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-top: none;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  z-index: 1040;
}

.alibaba-mega-nav-wrapper {
  position: relative;
  display: flex;
}

/* 1. Left Scrollable Categories Sidebar (Alibaba Style) */
.alibaba-cats-sidebar {
  list-style: none;
  margin: 0;
  padding: 4px 0;
  width: 100%;
  max-height: 485px;
  height: 485px;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 #f8fafc;
}

.alibaba-cats-sidebar::-webkit-scrollbar {
  width: 5px;
}
.alibaba-cats-sidebar::-webkit-scrollbar-track {
  background: #f8fafc;
}
.alibaba-cats-sidebar::-webkit-scrollbar-thumb {
  background-color: #cbd5e1;
  border-radius: 4px;
}
.alibaba-cats-sidebar::-webkit-scrollbar-thumb:hover {
  background-color: #94a3b8;
}

.alibaba-cat-item {
  position: static;
}

.alibaba-cat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  cursor: pointer;
  transition: all 0.12s ease;
  border-left: 3px solid transparent;
  text-decoration: none;
  color: #334155;
  font-size: 0.84rem;
}

.alibaba-cat-row:hover,
.alibaba-cat-item.active > .alibaba-cat-row {
  background: #fff5f5;
  color: var(--mic-red, #D62828);
  border-left-color: var(--mic-red, #D62828);
  font-weight: 600;
}

.alibaba-cat-icon {
  font-size: 1.1rem;
  width: 22px;
  margin-right: 8px;
  color: var(--mic-red, #D62828);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.alibaba-cat-name {
  font-size: 0.84rem;
  letter-spacing: -0.01em;
}

.alibaba-cat-badge {
  font-size: 0.64rem;
  font-weight: 600;
  background: #f1f5f9;
  color: #64748b;
  padding: 1px 6px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
}

.alibaba-cat-arrow {
  font-size: 0.75rem;
  color: #94a3b8;
  transition: transform 0.15s ease, color 0.15s ease;
  flex-shrink: 0;
}

.alibaba-cat-row:hover .alibaba-cat-arrow,
.alibaba-cat-item.active .alibaba-cat-arrow {
  color: var(--mic-red, #D62828);
  transform: translateX(3px);
}
.alibaba-cat-arrow.rotated {
  transform: rotate(90deg) !important;
  color: var(--mic-red, #D62828) !important;
}

/* 2. Right-Side Mega Menu Panels Host & Container (Alibaba Style) */
.alibaba-mega-panels-host {
  position: absolute;
  left: 100%;
  top: 0;
  width: 840px;
  height: 485px;
  z-index: 1060;
  pointer-events: none;
}

.alibaba-mega-panel {
  display: none;
  position: absolute;
  left: 0;
  top: 0;
  width: 840px;
  height: 485px;
  max-height: 485px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-left: 3px solid var(--mic-red, #D62828);
  border-radius: 0 8px 8px 0;
  box-shadow: 12px 14px 40px rgba(0,0,0,0.12);
  z-index: 1060;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 #f8fafc;
  pointer-events: auto;
  flex-direction: column;
}

.alibaba-mega-panel::-webkit-scrollbar {
  width: 6px;
}
.alibaba-mega-panel::-webkit-scrollbar-track {
  background: #f8fafc;
}
.alibaba-mega-panel::-webkit-scrollbar-thumb {
  background-color: #cbd5e1;
  border-radius: 4px;
}

.alibaba-mega-panel.active {
  display: flex !important;
  animation: alibabaFadeIn 0.15s ease-out;
}

@keyframes alibabaFadeIn {
  from { opacity: 0; transform: translateX(6px); }
  to { opacity: 1; transform: translateX(0); }
}

/* 3. Alibaba Visual Showcase: Popular in Sector (With Category Images) */
.alibaba-showcase-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
}

.alibaba-subcat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 6px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.18s ease;
}

.alibaba-subcat-card:hover {
  border-color: var(--mic-red, #D62828);
  background: #fff5f5;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(214, 40, 40, 0.12);
}

.alibaba-card-img-wrap img {
  border: 1px solid #f1f5f9;
  transition: transform 0.2s ease;
}

.alibaba-subcat-card:hover .alibaba-card-img-wrap img {
  transform: scale(1.06);
}

.alibaba-card-name {
  font-size: 0.72rem;
  font-weight: 600;
  color: #1e293b;
  line-height: 1.2;
  margin-top: 5px;
  text-align: center;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.alibaba-subcat-card:hover .alibaba-card-name {
  color: var(--mic-red, #D62828);
}

/* 4. Subcategories Directory Multi-Column Grid */
.alibaba-dept-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  transition: all 0.12s ease;
}

.alibaba-dept-card:hover {
  border-color: #cbd5e1;
  background: #fdfdfd;
}

.alibaba-dept-link:hover span {
  color: var(--mic-red, #D62828) !important;
}

.alibaba-subcat-text-link {
  display: flex;
  align-items: center;
  padding: 3px 0;
  font-size: 0.76rem;
  color: #475569;
  text-decoration: none;
  transition: all 0.12s ease;
}

.alibaba-subcat-text-link:hover {
  color: var(--mic-red, #D62828);
  padding-left: 4px;
  font-weight: 600;
}

.alibaba-leaf-item {
  transition: all 0.12s ease;
}

.alibaba-leaf-item:hover {
  background: #fff5f5 !important;
  border-color: var(--mic-red, #D62828) !important;
  transform: translateX(2px);
}

/* Responsive adjustments for 992px to 1199px */
@media (min-width: 992px) and (max-width: 1199.98px) {
  .alibaba-mega-panels-host,
  .alibaba-mega-panel {
    width: 690px;
  }
  .alibaba-showcase-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Mobile Screens (<= 991.98px) */
@media (max-width: 991.98px) {
  .alibaba-mega-panels-host {
    display: none !important;
  }
  .alibaba-cats-sidebar {
    height: auto !important;
    max-height: 75vh !important;
  }
}
