/* ==========================================================================
   Variables
   ========================================================================== */
:root {
  --primary:      #dd3333;
  --primary-dark: #bb2222;
  --dark:         #000000;
  --light:        #ffffff;
  --gray:         #6c757d;
  --bg-light:     #f8f9fa;
  --border:       #ddd;
  --gold:         #ffd700;
  --danger:       #dc3545;
  --shadow-sm:    0 4px 15px rgba(0,0,0,0.06);
  --shadow-md:    0 12px 24px rgba(0,0,0,0.15);
}

/* ==========================================================================
   Base
   ========================================================================== */
body {
  font-family: 'Montserrat', system-ui, -apple-system, sans-serif;
  background: var(--light);
  color: var(--dark);
  margin: 0;
  line-height: 1.6;
}

a { color: var(--dark); text-decoration: none; }
a:hover { color: var(--primary); }

.col-lg-9 a:not(.btn),
.accordion-body a:not(.btn),
section p a:not(.btn),
section li a:not(.btn) {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.col-lg-9 a:not(.btn):hover,
.accordion-body a:not(.btn):hover,
section p a:not(.btn):hover,
section li a:not(.btn):hover { text-decoration: none; }

.text-primary { color: var(--primary) !important; }

/* ==========================================================================
   Layout
   ========================================================================== */
.container {
  max-width: 1320px;
  padding-right: 15px;
  padding-left: 15px;
  margin-right: auto;
  margin-left: auto;
}

/* ==========================================================================
   Warning Bar
   ========================================================================== */
#warningBar {
  background: #ffd700;
  color: #1a1a1a;
  font-size: 0.85rem;
  position: relative;
  text-align: center;
  padding: 0.6rem 3rem 0.6rem 1rem;
}
#warningBar strong { color: #000; }
#warningBar button {
  position: absolute;
  top: 50%;
  right: 0.6rem;
  transform: translateY(-50%);
  background: none;
  border: 2px solid rgba(0,0,0,0.4);
  border-radius: 50%;
  width: 1.6rem;
  height: 1.6rem;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  color: #1a1a1a;
  padding: 0;
}
#warningBar button:hover {
  background-color: rgba(0,0,0,0.12);
  border-color: rgba(0,0,0,0.7);
}

/* Top Bar / Ticker
   ========================================================================== */
.top-bar {
  background: var(--primary);
  color: var(--light);
  font-size: 0.875rem;
  border-bottom: 1px solid var(--border);
}
.ticker-wrap { text-align: center; }
.ticker-text  { white-space: nowrap; }

@keyframes ticker-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}

/* ==========================================================================
   Navbar
   ========================================================================== */
.navbar-brand { padding: 0; }
.navbar-brand .logo { max-height: 50px; }

.navbar-nav {
  flex-wrap: wrap !important;
  gap: 8px 12px;
}

.nav-link {
  font-weight: 700;
  text-transform: uppercase;
  color: var(--dark) !important;
  padding: 10px 16px;
  border-radius: 6px;
  transition: all 0.2s;
  white-space: nowrap;
}
.nav-link:hover {
  color: var(--primary) !important;
  background: rgba(255,255,255,0.1);
}

@media (min-width: 1200px) {
  .navbar-nav { flex-wrap: nowrap !important; }
}
@media (max-width: 1199px) {
  .navbar-nav { justify-content: center; }
}

.search-form { min-width: 200px; }
.search-form input.form-control { min-width: 200px !important; }

/* ==========================================================================
   Hero Slider
   ========================================================================== */
.hero-slider .carousel-item img { height: 60vh; object-fit: cover; }
.hero-slider .carousel-caption {
  background: rgba(0,0,0,0.5);
  padding: 20px;
  border-radius: 10px;
}
.hero-slider .carousel-caption h1,
.hero-slider .carousel-caption p { color: var(--light); }
.hero-slider .btn-danger { background: var(--primary); border: none; }

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn-danger {
  background-color: var(--primary);
  border-color: var(--primary);
  color: var(--light);
}
.btn-danger:hover {
  background-color: var(--primary-dark);
  border-color: var(--primary-dark);
}
.btn-outline-dark { color: var(--dark); border-color: var(--dark); }
.btn-outline-dark:hover { background-color: var(--dark); color: var(--light); }

/* ==========================================================================
   Product Card
   ========================================================================== */
.product-card {
  background: var(--light);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  transition: transform 0.3s, box-shadow 0.3s;
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.product-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); }

.product-img {
  width: 100%;
  height: auto;
  object-fit: cover;
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
  padding: 0;
  background: none;
}

.product-main-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.sale-badge {
  background: var(--primary);
  color: var(--light);
  padding: 5px 10px;
  border-radius: 5px;
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 0.8rem;
}

.price { color: var(--primary); font-weight: bold; }
.old-price { text-decoration: line-through; color: var(--gray); margin-left: 5px; }
.stars { color: var(--gold); }

/* ==========================================================================
   Video Placeholders
   ========================================================================== */
.video-placeholder {
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
}

/* ==========================================================================
   Accordion
   ========================================================================== */
.accordion-button { background: var(--light); color: var(--dark); border: 1px solid var(--border); }
.accordion-button:not(.collapsed) { background: var(--bg-light); color: var(--primary); }
.accordion-body { background: var(--light); }

/* ==========================================================================
   Categories List
   ========================================================================== */
.list-unstyled a { display: block; padding: 10px 0; transition: color 0.3s; }
.list-unstyled a:hover { color: var(--primary); }

/* ==========================================================================
   Footer
   ========================================================================== */
.footer { background: var(--dark); color: var(--light); }
.footer a { color: var(--light); text-decoration: none; }
.footer a:hover { color: var(--primary); }
.footer h5 { color: var(--light); font-weight: bold; margin-bottom: 1rem; }
.footer-logo { max-width: 200px; }
.footer-reviews-link {
  display: inline-block;
  margin-top: 0.5rem;
  color: var(--primary) !important;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
}
.footer-reviews-link:hover { color: #fff !important; }

/* ==========================================================================
   Pagination
   ========================================================================== */
.pagination .page-item .page-link {
  color: var(--dark);
  background-color: var(--light);
  border: 1px solid var(--border);
}
.pagination .page-item.active .page-link,
.pagination .page-item .page-link:hover {
  background-color: var(--primary);
  border-color: var(--primary);
  color: var(--light);
}
.pagination .page-item.disabled .page-link {
  color: var(--gray);
  background-color: var(--light);
  border-color: var(--border);
}

/* ==========================================================================
   Cart
   ========================================================================== */
.cart-item { transition: box-shadow 0.3s ease; }
.cart-item:hover { box-shadow: var(--shadow-md); }

.cart-item-img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  background: var(--bg-light);
  padding: 10px;
}
@media (min-width: 577px) {
  .cart-item-img { width: 100px; height: 100px; }
}

.cart-summary { box-shadow: var(--shadow-sm); }
.cart-empty-message { box-shadow: var(--shadow-sm); border-radius: 10px; }
.js-subtotal { color: var(--dark); }

/* ==========================================================================
   Checkout / Forms
   ========================================================================== */
.form-label { font-weight: bold; color: var(--dark); font-size: 1rem; }
.form-control,
.form-select {
  font-size: 1rem;
  border-radius: 0.5rem;
  background: var(--light);
  border: 1px solid var(--border);
}
.form-control-lg,
.form-select-lg { border-radius: 0.375rem; }
.form-check-input { margin-top: 0.25rem; }
.invalid-feedback { color: var(--danger); }

.form-control:focus,
.form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.2);
  outline: none;
}
.form-check-input:focus {
  box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.2);
  border-color: var(--primary);
}
.form-check-input:checked {
  background-color: var(--primary);
  border-color: var(--primary);
}

.checkout-page { background-color: var(--bg-light) !important; }
.checkout-page .text-primary { color: var(--primary) !important; }

/* ==========================================================================
   Best Sellers sidebar block
   ========================================================================== */
.best-seller-item {
  color: var(--dark);
  transition: background 0.15s;
}
.best-seller-item:hover { background: var(--bg-light); color: var(--primary); }
.best-seller-rank {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--gray);
  min-width: 1.2rem;
  text-align: center;
}
.best-seller-img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  flex-shrink: 0;
  background: var(--bg-light);
  border-radius: 4px;
}
.best-seller-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.best-seller-title {
  font-size: 0.8rem;
  line-height: 1.3;
  color: inherit;
}
.best-seller-tag {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--primary);
  background: rgba(220,53,69,0.08);
  border-radius: 3px;
  padding: 1px 4px;
  margin-left: 4px;
  vertical-align: middle;
  letter-spacing: 0.03em;
}
.best-seller-substance {
  font-size: 0.72rem;
  color: var(--gray);
  line-height: 1.2;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==========================================================================
   Order Page
   ========================================================================== */
.order-page .table-responsive { overflow-x: auto; width: 100%; }

@media (min-width: 992px) {
  .order-page .row.g-4 { --bs-gutter-x: 1.5rem; --bs-gutter-y: 1.5rem; }
}

/* ==========================================================================
   Sidebar
   ========================================================================== */
aside.sidebar {
  position: sticky;
  top: 1rem;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
}

.sidebar .filter-card,
.filter-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.sidebar .filter-title,
.filter-title {
  margin: 0;
  padding: 12px 16px;
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--dark);
  background: var(--bg-light);
  border-bottom: 1px solid var(--border);
  cursor: default;
  user-select: none;
  text-align: center;
}
.sidebar .filter-content { padding: 8px 0; }
.sidebar .filter-link-item { margin: 0; }
.sidebar .filter-link-item > a {
  display: block;
  padding: 8px 16px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--dark);
  border-left: 3px solid transparent;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.sidebar .filter-link-item > a:hover {
  color: var(--primary);
  background: rgba(255,0,0,0.04);
  border-left-color: var(--primary);
}
.sidebar .filter-link-item > a.active {
  color: var(--primary);
  border-left-color: var(--primary);
  font-weight: 700;
}
.sidebar .filter-link-item.child > a {
  font-size: 0.85rem;
  font-weight: 500;
  padding-left: 12px;
}
.sidebar .ms-4 {
  margin-left: 0 !important;
  padding-left: 0;
  border-left: none;
  background: var(--bg-light);
}

/* ==========================================================================
   Rich Content (catalog description + product description)
   ========================================================================== */
.catalog-description,
.product-description {
  font-size: 0.95rem;
  line-height: 1.8;
  color: #333;
}
.catalog-description h1,
.product-description h1 {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0 0 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--primary);
  color: var(--dark);
}
.catalog-description h1 strong,
.catalog-description h2 strong,
.catalog-description h3 strong,
.product-description h1 strong,
.product-description h2 strong,
.product-description h3 strong,
.product-description h4 strong { font-weight: inherit; }

.catalog-description h2,
.product-description h2 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 2rem 0 0.6rem;
  color: var(--dark);
}
.catalog-description h3,
.product-description h3 {
  font-size: 0.95rem;
  font-weight: 700;
  font-style: italic;
  margin: 1.25rem 0 0.3rem;
  color: #444;
}
.catalog-description p,
.product-description p { margin-bottom: 0.9rem; }

.catalog-description ul,
.catalog-description ol,
.product-description ul,
.product-description ol { padding-left: 1.5rem; margin-bottom: 1rem; }

.catalog-description li,
.product-description li { margin-bottom: 0.3rem; }

.catalog-description a:not(.btn),
.product-description a:not(.btn) {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.catalog-description a:not(.btn):hover,
.product-description a:not(.btn):hover { text-decoration: none; }

/* Video embed wrapper inside description */
.product-description div:has(> iframe) { margin: 1.5rem 0; }

/* Unpacking promo phrase (imported from WP as h3 with inline orange color) */
.product-description h3[style*="color"] {
  color: var(--primary) !important;
  font-size: 1.1rem;
  font-weight: 400;
  font-style: normal;
}

/* Product description extras */
.product-description h4 { font-size: 0.9rem; font-weight: 700; margin: 1rem 0 0.3rem; color: var(--dark); }
.product-description img { max-width: 100%; height: auto; border-radius: 6px; margin: 0.5rem 0 1rem; }
.product-description table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}
.product-description th,
.product-description td { padding: 8px 12px; border: 1px solid var(--border); text-align: left; }
.product-description th { background: var(--bg-light); font-weight: 700; }

/* ==========================================================================
   Product Specs (excerpt)
   ========================================================================== */
.product-specs {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  font-size: 0.875rem;
}
.product-specs__row {
  display: flex;
  padding: 7px 14px;
  border-bottom: 1px solid var(--border);
}
.product-specs__row:last-child { border-bottom: none; }
.product-specs__row:nth-child(even) { background: var(--bg-light); }
.product-specs dt { flex: 0 0 42%; font-weight: 600; color: var(--gray); }
.product-specs dd { margin: 0; color: var(--dark); }

/* ==========================================================================
   Product Meta (Brand / Category / Tags)
   ========================================================================== */
.product-meta { font-size: 0.875rem; }
.product-meta__row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 5px 0;
}
.product-meta__label {
  flex: 0 0 80px;
  color: var(--gray);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
}
.product-meta__value a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.product-meta__value a:hover { text-decoration: none; }

/* ==========================================================================
   Product Tabs
   ========================================================================== */
#productTabs {
  margin-bottom: 0 !important;
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
#productTabs .nav-item { flex-shrink: 0; }
#productTabs .nav-link {
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--gray);
  border-radius: 6px 6px 0 0;
  padding: 10px 20px;
}
#productTabs .nav-link:hover { color: var(--dark); }
#productTabs {
  border-bottom: none;
}
#productTabs .nav-link.active {
  color: var(--dark);
  background: var(--light);
  border-color: #dee2e6 #dee2e6 var(--light);
}
#productTabsContent {
  background: var(--light);
  border: 1px solid #dee2e6;
  border-top: none;
  border-radius: 0 0 8px 8px;
}
#productTabsContent .tab-pane { padding: 1.75rem 2rem; }

/* ==========================================================================
   Categories A-Z
   ========================================================================== */
.categories-az .col { padding: 0; }
.categories-az .col a {
  display: block;
  padding: 7px 14px;
  color: #222;
  text-decoration: none;
  font-size: .9rem;
  border-bottom: 1px solid #e9ecef;
  transition: background .15s, color .15s;
}
.categories-az .col a:hover { background: var(--primary); color: var(--light); }

/* ==========================================================================
   Toastr — mobile override
   ========================================================================== */
@media (max-width: 991px) {
  #toast-container.toast-top-right,
  #toast-container.toast-bottom-right,
  #toast-container.toast-top-left,
  #toast-container.toast-bottom-full-width {
    top: auto !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100% !important;
    padding: 0 !important;
  }
  #toast-container.toast-top-right > div,
  #toast-container.toast-bottom-right > div,
  #toast-container.toast-top-left > div,
  #toast-container.toast-bottom-full-width > div {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    border-radius: 0 !important;
  }
}

/* ==========================================================================
   Responsive — tablet and below (≤ 991px)
   ========================================================================== */
@media (max-width: 991px) {
  /* Ticker */
  .ticker-wrap { overflow: hidden; width: 100%; }
  .ticker-text { display: inline-block; padding-left: 100%; animation: ticker-scroll 20s linear infinite; }

  /* Navbar */
  .navbar-brand .logo { max-height: 44px; width: auto; }
  .navbar-nav { flex-direction: column; gap: 2px; width: 100%; text-align: center; }
  .navbar-nav .nav-link { width: 100%; text-align: left; padding: 12px 20px; }
  .search-form { width: 100%; margin-top: 1rem; }

  /* Single-column sections */
  .footer .row > [class*="col-"],
  .blog-section .row > [class*="col-"],
  .random-products-grid > [class*="col-"],
  #videos .row > [class*="col-"] {
    flex: 0 0 100% !important;
    max-width: 100% !important;
    width: 100% !important;
  }
  .footer-logo { display: block; margin: 0 auto; }

  /* Layout */
  .sticky-top { position: static !important; }
  .sidebar { margin-bottom: 2rem; }
  .best-sellers-card { display: none !important; }

  /* Order page */
  .order-page.container {
    max-width: 100% !important;
    width: 100% !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  .order-page .row { margin-left: 0 !important; margin-right: 0 !important; }
  .order-page .col-lg-8,
  .order-page .col-lg-4 {
    flex: 0 0 100% !important;
    max-width: 100% !important;
    width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  .order-page .card { width: 100% !important; }
}

/* ==========================================================================
   Responsive — tablet portrait (≤ 768px)
   ========================================================================== */
@media (max-width: 768px) {
  /* Hero slider */
  .hero-slider .carousel-item img { height: 40vh; }
  .hero-slider .carousel-caption { padding: 10px 12px; bottom: 10px; left: 8%; right: 8%; }
  .hero-slider .carousel-caption h1 { font-size: 1.1rem; margin-bottom: 4px; }
  .hero-slider .carousel-caption p { font-size: 0.8rem; margin-bottom: 8px; }
  .hero-slider .btn-danger { font-size: 0.8rem; padding: 6px 16px; }

  /* Product tabs */
  .js-add-to-cart,
  .btn-outline-secondary[disabled] { display: block; width: 100%; }
  #productTabs { border-bottom: none !important; }
  #productTabs .nav-link {
    font-size: 0.75rem;
    padding: 8px 12px;
    letter-spacing: 0.02em;
    border-bottom: none !important;
  }
  #productTabsContent { border-top: 1px solid #dee2e6; border-radius: 0; }
  #productTabsContent .tab-pane { padding: 1.25rem; }
}

/* ==========================================================================
   Responsive — mobile (≤ 576px)
   ========================================================================== */
@media (max-width: 576px) {
  /* Typography */
  h1.h2, h2 { font-size: 1.5rem; }

  /* Spacing */
  .p-3   { padding: 1rem !important; }
  .p-4   { padding: 1.5rem !important; }
  .p-md-4 { padding: 1.25rem !important; }
  .p-lg-5 { padding: 1.5rem !important; }

  /* Buttons / forms */
  .btn-lg { font-size: 0.9rem; padding: 0.5rem 1rem; }
  .form-label { font-size: 0.9rem; }
  .form-control, .form-select { font-size: 0.9rem; }
  .search-form { width: 100% !important; margin-bottom: 10px; }

  /* Product grid */
  .product-img { max-height: 180px; }
  .row.g-4 [class*="col-"] { flex: 0 0 50%; max-width: 50%; }
  .blog-section .row > [class*="col-"] { flex: 0 0 100% !important; max-width: 100% !important; width: 100% !important; }

  /* Pagination */
  .pagination { flex-wrap: wrap; justify-content: center; }
  .pagination .page-item { margin: 2px; }
  .pagination .page-link { padding: 0.25rem 0.5rem; font-size: 0.875rem; }

  /* Cart item */
  .cart-item {
    position: relative;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: flex-start !important;
    text-align: left;
  }
  .cart-item-img { width: 70px !important; height: 70px !important; flex-shrink: 0; }
  .cart-item .me-3 { margin-right: 12px !important; margin-bottom: 0 !important; }
  .cart-item .flex-grow-1 { padding-right: 30px; min-width: 0; }
  .cart-item .js-remove-item { position: absolute !important; top: 10px !important; right: 10px !important; margin: 0 !important; }
  .cart-item .ms-auto { display: none; }
  .cart-item .qty-input { width: 100px !important; }

  /* Sidebar */
  .sidebar .filter-content { padding: 10px; }
  .sidebar .filter-link-item > a { padding: 12px; font-size: .98rem; }
  .sidebar .ms-4 { margin-left: 12px !important; padding-left: 10px; }
}
