:root {
  --primary-color: #e30019; /* GearVN red */
  --secondary-color: #212529; /* dark gray */
  --light-bg: #f8f9fa;
}

html {
  font-size: 80%;
}

body {
  font-family: 'Inter', 'Roboto', sans-serif;
  background-color: #f4f6f8;
  margin-bottom: 0;
  font-size: 1rem;
}

/* Thu nhỏ container chính */
@media (min-width: 1200px) {
  .container {
    max-width: 1140px; 
  }
}
@media (min-width: 1400px) {
  .container {
    max-width: 1240px; /* Thay vì 1320px mặc định của Bootstrap 5 */
  }
}

/* Header Styles */
.header-top {
  background-color: #f8f9fa;
  font-size: 0.85rem;
}
.header-top a {
  color: #333;
  text-decoration: none;
}
.header-top a:hover {
  color: var(--primary-color);
}

.header-main {
  background-color: var(--primary-color);
  padding: 10px 0;
}
.header-main .navbar-brand {
  color: white;
  font-weight: bold;
  font-size: 1.65rem;
  letter-spacing: 1px;
}
.header-main .navbar-brand:hover {
  color: #f8f9fa;
}
.search-form .form-control {
  border-radius: 4px 0 0 4px;
  border: none;
}
.search-form .btn {
  border-radius: 0 4px 4px 0;
  background-color: white;
  color: var(--primary-color);
  border: none;
}
.search-form .btn:hover {
  background-color: #f1f1f1;
}

.header-icon-box {
  color: white;
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.header-icon-box:hover {
  color: #ffcccc;
}
.header-icon-box i {
  font-size: 1.35rem;
}
.header-icon-box span {
  font-size: 0.85rem;
  line-height: 1.2;
}

/* Navbar Menu */
.main-nav {
  background-color: white;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
.main-nav .nav-link {
  color: #333;
  font-weight: 600;
  padding: 11px 16px;
  text-transform: uppercase;
  font-size: 0.9rem;
}
.main-nav .nav-link:hover {
  color: var(--primary-color);
}
.main-nav .nav-item:not(:last-child) {
  border-right: 1px solid #eee;
}

/* Footer */
.footer {
  background-color: var(--secondary-color);
  color: #ccc;
  padding: 40px 0 20px;
  margin-top: 50px;
  font-size: 0.9rem;
}
.footer h5 {
  color: white;
  font-weight: bold;
  margin-bottom: 20px;
}
.footer a {
  color: #ccc;
  text-decoration: none;
  display: block;
  margin-bottom: 10px;
}
.footer a:hover {
  color: var(--primary-color);
  padding-left: 5px;
  transition: all 0.3s ease;
}

/* Product Details Styles */
.breadcrumb-wrap {
  background: white;
  padding: 10px 0;
  margin-bottom: 20px;
  border-bottom: 1px solid #eee;
  font-size: 0.9rem;
}
.breadcrumb-wrap a {
  color: #0077cc;
  text-decoration: none;
}
.breadcrumb-wrap a:hover {
  text-decoration: underline;
}
.product-gallery {
  background: white;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
.main-img-wrap {
  border: 1px solid #eee;
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 15px;
  text-align: center;
}
.main-img-wrap img {
  max-width: 100%;
  height: 300px; /* Giảm từ 400px */
  object-fit: contain;
}
.thumb-gallery {
  display: flex;
  gap: 10px;
  overflow-x: auto;
}
.thumb-item {
  width: 80px;
  height: 80px;
  border: 1px solid #eee;
  border-radius: 4px;
  padding: 5px;
  cursor: pointer;
}
.thumb-item:hover, .thumb-item.active {
  border-color: var(--primary-color);
}
.thumb-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.product-info-box {
  background: white;
  border-radius: 8px;
  padding: 20px; /* Giảm từ 30px */
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
.pd-title {
  font-size: 1.3rem; /* Nhỏ lại từ 1.5rem */
  font-weight: 700;
  margin-bottom: 12px;
  color: #333;
}
.pd-brand {
  font-size: 0.9rem;
  color: #666;
  margin-bottom: 20px;
}
.pd-brand strong {
  color: #333;
}
.pd-price-box {
  background: #f8f9fa;
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 25px;
}
.pd-current-price {
  font-size: 1.6rem; /* Nhỏ lại từ 2rem */
  font-weight: 700;
  color: var(--primary-color);
  margin-right: 15px;
}
.pd-old-price {
  font-size: 1rem; /* Nhỏ lại */
  text-decoration: line-through;
  color: #999;
}
.pd-status {
  font-size: 1rem;
  margin-bottom: 20px;
}
.pd-status .in-stock {
  color: #28a745;
  font-weight: 600;
}
.pd-status .out-of-stock {
  color: #dc3545;
  font-weight: 600;
}
.btn-buy-now {
  background-color: var(--primary-color);
  color: white;
  font-size: 1.1rem; /* Nhỏ lại từ 1.2rem */
  font-weight: bold;
  padding: 12px; /* Nhỏ lại từ 15px */
  border-radius: 8px;
  border: none;
  width: 100%;
  text-transform: uppercase;
  margin-bottom: 10px;
  transition: all 0.3s;
}
.btn-buy-now:hover {
  background-color: #cc0015;
  color: white;
}
.btn-add-cart {
  background-color: white;
  color: var(--primary-color);
  font-size: 0.95rem; /* Nhỏ lại từ 1rem */
  font-weight: bold;
  padding: 10px; /* Nhỏ lại từ 12px */
  border-radius: 8px;
  border: 2px solid var(--primary-color);
  width: 100%;
  text-transform: uppercase;
  transition: all 0.3s;
}
.btn-add-cart:hover {
  background-color: #fcebeb;
}
.pd-specs-table {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
  overflow: hidden;
}
.pd-specs-table th {
  background-color: #f8f9fa;
  width: 30%;
  font-weight: 600;
}

/* Homepage Styles */
.hero-slider {
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  margin-bottom: 30px;
}
.hero-slider img {
  object-fit: cover;
  height: 320px; /* Giảm từ 400px */
}
.category-box {
  background: white;
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  transition: all 0.3s ease;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.category-box:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(227, 0, 25, 0.2);
  border: 1px solid var(--primary-color);
}
.category-box i {
  font-size: 2.5rem;
  color: var(--primary-color);
  margin-bottom: 10px;
}
.section-title {
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 20px;
  position: relative;
  display: inline-block;
}
.section-title::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -5px;
  width: 50%;
  height: 3px;
  background-color: var(--primary-color);
}
.flash-sale-section {
  background: linear-gradient(135deg, #1a1a1a 0%, #330000 100%);
  padding: 30px;
  border-radius: 12px;
  color: white;
  margin-bottom: 40px;
}
.flash-sale-section .section-title {
  color: #ffcccc;
}
.product-card {
  background: white;
  border-radius: 8px;
  padding: 15px;
  transition: all 0.3s ease;
  position: relative;
  border: 1px solid #eee;
  height: 100%;
  display: flex;
  flex-direction: column;
}
.product-card:hover {
  box-shadow: 0 10px 20px rgba(0,0,0,0.1);
  transform: translateY(-5px);
  border-color: var(--primary-color);
}
.product-img {
  width: 100%;
  height: 200px;
  object-fit: contain;
  margin-bottom: 15px;
}
.product-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #333;
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 10px;
}
.product-title:hover {
  color: var(--primary-color);
}
.product-price {
  color: var(--primary-color);
  font-weight: 700;
  font-size: 1.2rem;
  margin-top: auto;
}
.product-old-price {
  text-decoration: line-through;
  color: #999;
  font-size: 0.85rem;
  margin-left: 10px;
}
.btn-cart {
  background-color: var(--primary-color);
  color: white;
  border: none;
  width: 100%;
  padding: 8px;
  border-radius: 4px;
  font-weight: 600;
  margin-top: 15px;
  transition: background-color 0.2s;
}
.btn-cart:hover {
  background-color: #cc0015;
  color: white;
}
.discount-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: var(--primary-color);
  color: white;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: bold;
  z-index: 2;
}

/* Responsive layout */
@media (max-width: 991.98px) {
  .container {
    max-width: 100%;
  }

  .main-nav .nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    justify-content: flex-start !important;
  }

  .main-nav .nav-link {
    white-space: nowrap;
  }

  .filter-sidebar {
    position: static !important;
  }
}

@media (max-width: 767.98px) {
  html {
    font-size: 78%;
  }

  body {
    padding-bottom: 66px;
    overflow-x: hidden;
  }

  .header-main {
    padding: 8px 0;
  }

  .header-main .container,
  .page-shell {
    padding-left: 10px;
    padding-right: 10px;
  }

  .header-main .navbar-brand {
    font-size: 1.45rem;
    letter-spacing: 0;
    white-space: nowrap;
  }

  .header-main .navbar-brand i {
    font-size: 1.35rem;
    margin-right: 0.35rem !important;
  }

  .search-form .form-control {
    height: 34px;
    font-size: 0.9rem;
    padding: 0.35rem 0.75rem;
  }

  .search-form .btn {
    height: 34px;
    padding-left: 0.85rem !important;
    padding-right: 0.85rem !important;
  }

  .page-shell {
    margin-top: 0.75rem !important;
  }

  .breadcrumb-wrap {
    margin-bottom: 10px;
    padding: 8px 0 !important;
  }

  .footer {
    display: none;
  }

  .mobile-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1040;
    height: 58px;
    background: #fff;
    border-top: 1px solid #e9ecef;
    box-shadow: 0 -4px 18px rgba(0,0,0,0.08);
    display: grid;
    grid-template-columns: repeat(5, 1fr);
  }

  .mobile-nav-item {
    color: #343a40;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-width: 0;
    font-size: 0.72rem;
    font-weight: 600;
  }

  .mobile-nav-item i {
    font-size: 1.2rem;
  }

  .mobile-nav-item:hover,
  .mobile-nav-item:focus {
    color: var(--primary-color);
  }

  .mobile-cart-badge {
    position: absolute;
    top: 5px;
    right: calc(50% - 18px);
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--primary-color);
    color: #fff;
    font-size: 0.65rem;
    line-height: 16px;
    text-align: center;
  }

  .category-showcase-wrap {
    padding: 12px !important;
    border-radius: 10px !important;
    overflow: hidden;
  }

  .category-showcase-wrap h4 {
    font-size: 1.05rem;
  }

  .product-scroll-container {
    gap: 10px !important;
    padding-left: 0;
    padding-right: 0;
    flex-wrap: wrap;
    overflow: visible !important;
    scroll-snap-type: none;
  }

  .product-scroll-container .product-card-link {
    flex: 0 0 calc((100% - 10px) / 2) !important;
    max-width: calc((100% - 10px) / 2) !important;
    width: calc((100% - 10px) / 2) !important;
    height: auto !important;
  }

  .product-scroll-container .product-card-modern {
    width: 100% !important;
    max-width: 100% !important;
    min-height: 372px !important;
    border-radius: 10px !important;
    scroll-snap-align: unset;
  }

  .product-scroll-container .img-wrap {
    padding: 10px !important;
  }

  .product-scroll-container .img-wrap img {
    height: 108px !important;
  }

  .product-scroll-container .card-body-custom {
    padding-left: 10px !important;
    padding-right: 10px !important;
    padding-bottom: 10px !important;
  }

  .product-scroll-container .product-name {
    font-size: 0.88rem;
  }

  .product-scroll-container .specs-box-mini {
    min-height: 46px !important;
    margin-bottom: 0.65rem !important;
  }

  .product-scroll-container .spec-tag {
    font-size: 0.64rem !important;
    min-height: 23px;
    padding: 2px 4px !important;
  }

  .product-scroll-container .price-wrap {
    min-height: 52px;
  }

  .product-scroll-container .current-price {
    font-size: 1.08rem !important;
  }

  .product-scroll-container .btn {
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
  }

  .hero-slider {
    height: 230px !important;
    border-radius: 10px !important;
    margin-bottom: 12px;
  }

  .hero-slider .carousel-caption {
    display: block !important;
    left: 7%;
    right: 7%;
    bottom: 12%;
    text-align: left !important;
  }

  .hero-slider .carousel-caption h2 {
    font-size: 1.35rem;
    line-height: 1.15;
    margin-bottom: 0.5rem !important;
    max-width: 70%;
  }

  .hero-slider .carousel-caption p {
    font-size: 0.82rem !important;
    margin-bottom: 0.75rem !important;
    max-width: 72%;
  }

  .hero-slider .carousel-caption .btn {
    font-size: 0.78rem;
    padding: 0.4rem 0.85rem !important;
  }

  .hero-slider .carousel-indicators {
    margin-bottom: 0.45rem;
  }

  .hero-control {
    width: 13% !important;
  }

  .hero-control .carousel-control-prev-icon,
  .hero-control .carousel-control-next-icon {
    width: 1.35rem !important;
    height: 1.35rem !important;
    padding: 0.85rem !important;
  }

  .scroll-btn {
    display: none !important;
  }

  .filter-sidebar {
    border-radius: 10px !important;
    margin-bottom: 12px;
  }

  .desktop-filter {
    display: none;
  }

  .mobile-filter-canvas {
    padding-bottom: 62px;
  }

  .mobile-filter-canvas .offcanvas-body {
    padding-bottom: 82px;
  }

  .filter-sidebar .p-3 {
    padding: 0.8rem !important;
  }

  .product-card-modern {
    min-height: 390px !important;
    padding: 10px !important;
    border-radius: 10px !important;
  }

  .product-card-modern img {
    height: 118px !important;
  }

  .text-truncate-2 {
    font-size: 0.86rem !important;
  }

  .specs-box-mini {
    min-height: 42px !important;
    margin-bottom: 0.75rem !important;
  }

  .spec-tag {
    padding: 3px 5px !important;
    font-size: 0.65rem !important;
  }

  .price-box {
    min-height: 50px !important;
    margin-bottom: 0.75rem !important;
  }

  .price-box .fs-5 {
    font-size: 1.12rem !important;
  }

  .product-card-modern .btn {
    font-size: 0.78rem;
    padding-top: 0.48rem !important;
    padding-bottom: 0.48rem !important;
  }

  .product-gallery,
  .product-info-box,
  .bg-white.rounded-4 {
    border-radius: 10px !important;
    padding: 14px !important;
  }

  .main-img-wrap {
    height: auto !important;
    min-height: 260px;
  }

  .main-img-wrap img {
    height: 240px;
  }
}

@media (max-width: 420px) {
  .header-main .navbar-brand {
    font-size: 1.25rem;
  }

  .product-scroll-container .product-card-modern {
    min-height: 360px !important;
  }

  .product-scroll-container .img-wrap img {
    height: 96px !important;
  }

  .product-card-modern {
    min-height: 372px !important;
  }

  .product-card-modern img {
    height: 104px !important;
  }
}
