/* =============================================
   HILGOD ONLINE STORE — MAIN CSS
   Design System / Tokens / Reset / Utilities
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Poppins:wght@400;500;600;700;800;900&display=swap');

/* ---- CSS CUSTOM PROPERTIES ---- */
:root {
  /* Brand Colors */
  --primary: #E31C1C;
  --primary-dark: #b51515;
  --primary-light: #ff3333;
  --primary-xlight: #fff0f0;
  --accent: #ff6b00;
  --accent-light: #fff3e8;

  /* Neutrals */
  --dark: #1a1a1a;
  --dark-2: #2d2d2d;
  --dark-3: #444444;
  --gray-1: #666666;
  --gray-2: #999999;
  --gray-3: #cccccc;
  --gray-4: #e5e5e5;
  --gray-5: #f2f2f2;
  --gray-6: #f8f8f8;
  --white: #ffffff;

  /* Status */
  --success: #16a34a;
  --success-light: #f0fdf4;
  --warning: #d97706;
  --warning-light: #fffbeb;
  --info: #0369a1;
  --info-light: #f0f9ff;
  --danger: #dc2626;
  --danger-light: #fef2f2;

  /* Typography */
  --font-primary: 'Inter', sans-serif;
  --font-display: 'Poppins', sans-serif;

  /* Spacing Scale */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  /* Border Radius */
  --radius-sm: 4px;
  --radius: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, .08);
  --shadow: 0 2px 8px rgba(0, 0, 0, .10);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, .12);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, .14);
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, .18);
  --shadow-red: 0 4px 20px rgba(227, 28, 28, .25);

  /* Transitions */
  --transition: 0.22s ease;
  --transition-fast: 0.12s ease;
  --transition-slow: 0.4s ease;

  /* Z-index */
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-modal: 300;
  --z-toast: 400;
}

/* ---- RESET ---- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

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

img {
  display: block;
  max-width: 100%;
  object-fit: cover;
}

a {
  text-decoration: none;
  color: inherit;
}

ul,
ol {
  list-style: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

input,
select,
textarea {
  font-family: inherit;
  outline: none;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-display);
  line-height: 1.25;
}

table {
  border-collapse: collapse;
  width: 100%;
}

/* ---- TYPOGRAPHY ---- */
.text-xs {
  font-size: .75rem;
}

.text-sm {
  font-size: .875rem;
}

.text-base {
  font-size: 1rem;
}

.text-lg {
  font-size: 1.125rem;
}

.text-xl {
  font-size: 1.25rem;
}

.text-2xl {
  font-size: 1.5rem;
}

.text-3xl {
  font-size: 1.875rem;
}

.text-4xl {
  font-size: 2.25rem;
}

.fw-400 {
  font-weight: 400;
}

.fw-500 {
  font-weight: 500;
}

.fw-600 {
  font-weight: 600;
}

.fw-700 {
  font-weight: 700;
}

.fw-800 {
  font-weight: 800;
}

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

.text-gray {
  color: var(--gray-1);
}

.text-white {
  color: var(--white);
}

.text-center {
  text-align: center;
}

/* ---- LAYOUT ---- */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--space-4);
}

.section {
  padding: var(--space-10) 0;
}

.page-wrapper {
  padding-top: var(--space-4);
  /* no offset needed since header is sticky, not fixed */
  min-height: 100vh;
}

/* ---- FLEX/GRID UTILS ---- */
.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.items-start {
  align-items: flex-start;
}

.justify-center {
  justify-content: center;
}

.justify-between {
  justify-content: space-between;
}

.justify-end {
  justify-content: flex-end;
}

.gap-1 {
  gap: var(--space-1);
}

.gap-2 {
  gap: var(--space-2);
}

.gap-3 {
  gap: var(--space-3);
}

.gap-4 {
  gap: var(--space-4);
}

.gap-6 {
  gap: var(--space-6);
}

.gap-8 {
  gap: var(--space-8);
}

.grid {
  display: grid;
}

.w-full {
  width: 100%;
}

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 10px 22px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: .9rem;
  transition: all var(--transition);
  white-space: nowrap;
  cursor: pointer;
}

.btn-primary {
  background: var(--primary);
  color: var(--white);
  box-shadow: var(--shadow-red);
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(227, 28, 28, .35);
}

.btn-secondary {
  background: var(--white);
  color: var(--primary);
  border: 2px solid var(--primary);
}

.btn-secondary:hover {
  background: var(--primary);
  color: var(--white);
}

.btn-dark {
  background: var(--dark);
  color: var(--white);
}

.btn-dark:hover {
  background: var(--dark-2);
}

.btn-outline {
  background: transparent;
  color: var(--dark);
  border: 1.5px solid var(--gray-3);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-sm {
  padding: 7px 16px;
  font-size: .8rem;
}

.btn-lg {
  padding: 14px 32px;
  font-size: 1rem;
}

.btn-full {
  width: 100%;
}

.btn-icon {
  padding: 10px;
  border-radius: var(--radius);
}

/* ---- BADGE ---- */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: .7rem;
  font-weight: 700;
}

.badge-primary {
  background: var(--primary);
  color: var(--white);
}

.badge-success {
  background: var(--success);
  color: var(--white);
}

.badge-warning {
  background: var(--warning);
  color: var(--white);
}

.badge-count {
  position: absolute;
  top: -6px;
  right: -7px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  background: var(--primary);
  color: var(--white);
  border-radius: var(--radius-full);
  font-size: .65rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--white);
}

/* ---- CARD ---- */
.card {
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: all var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

/* ---- PRODUCT CARD ---- */
.product-card {
  background: var(--white);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
  position: relative;
}

.product-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

.product-card__badges {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.product-card__badge {
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-size: .68rem;
  font-weight: 700;
}

.badge-hot {
  background: var(--primary);
  color: #fff;
}

.badge-new {
  background: var(--success);
  color: #fff;
}

.badge-sale {
  background: var(--accent);
  color: #fff;
}

.badge-toprated {
  background: #7c3aed;
  color: #fff;
}

.product-card__wishlist {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all var(--transition);
  color: var(--gray-2);
}

.product-card__wishlist:hover,
.product-card__wishlist.active {
  color: var(--primary);
  background: var(--white);
}

.product-card__wishlist.active {
  color: var(--primary);
}

.product-card__img-wrapper {
  position: relative;
  overflow: hidden;
  background: var(--gray-6);
  height: 200px;
}

.product-card__img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 12px;
  transition: transform var(--transition-slow);
}

.product-card:hover .product-card__img-wrapper img {
  transform: scale(1.06);
}

.product-card__quick-view {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: rgba(227, 28, 28, .88);
  color: #fff;
  text-align: center;
  padding: 8px;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .3px;
  transform: translateY(100%);
  transition: transform var(--transition);
  cursor: pointer;
}

.product-card:hover .product-card__quick-view {
  transform: translateY(0);
}

.product-card__body {
  padding: 14px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.product-card__brand {
  font-size: .72rem;
  color: var(--gray-1);
  margin-bottom: 3px;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.product-card__name {
  font-size: .9rem;
  font-weight: 600;
  color: var(--dark);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 6px;
  line-height: 1.4;
}

.product-card__rating {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 8px;
}

.stars {
  display: flex;
  gap: 2px;
}

.stars i {
  font-size: .72rem;
  color: #f59e0b;
}

.stars i.empty {
  color: var(--gray-3);
}

.rating-count {
  font-size: .72rem;
  color: var(--gray-2);
}

.product-card__pricing {
  margin-top: auto;
  margin-bottom: 12px;
}

.product-card__price {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
}

.product-card__original {
  font-size: .8rem;
  color: var(--gray-2);
  text-decoration: line-through;
  margin-left: 6px;
}

.product-card__discount {
  font-size: .78rem;
  color: var(--success);
  font-weight: 600;
  margin-left: 4px;
}

.product-card__actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
}

.btn-add-cart {
  flex: 1;
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius);
  padding: 9px 12px;
  font-size: .83rem;
  font-weight: 600;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-add-cart:hover {
  background: var(--primary-dark);
}

.btn-add-cart.added {
  background: var(--success);
}

/* ---- SECTION HEADER ---- */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-4);
  border-bottom: 2px solid var(--gray-4);
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title .bar {
  width: 4px;
  height: 24px;
  background: var(--primary);
  border-radius: var(--radius-full);
  display: inline-block;
}

.section-link {
  color: var(--primary);
  font-size: .9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: gap var(--transition);
}

.section-link:hover {
  gap: 8px;
}

/* ---- BREADCRUMB ---- */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: var(--space-4) 0;
  font-size: .85rem;
  color: var(--gray-1);
}

.breadcrumb a {
  color: var(--gray-1);
  transition: color var(--transition);
}

.breadcrumb a:hover {
  color: var(--primary);
}

.breadcrumb .sep {
  font-size: .75rem;
}

.breadcrumb .current {
  color: var(--dark);
  font-weight: 500;
}

/* ---- RATING STARS DISPLAY ---- */
.rating-display {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ---- TOAST NOTIFICATIONS ---- */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--dark);
  color: var(--white);
  padding: 14px 20px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: .88rem;
  font-weight: 500;
  pointer-events: all;
  animation: toastIn .3s ease forwards;
  min-width: 280px;
  max-width: 360px;
  border-left: 4px solid var(--primary);
}

.toast.success {
  border-left-color: var(--success);
}

.toast.warning {
  border-left-color: var(--warning);
}

.toast.error {
  border-left-color: var(--danger);
}

.toast__icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}

.toast.success .toast__icon {
  color: var(--success);
}

.toast.warning .toast__icon {
  color: var(--warning);
}

.toast.error .toast__icon {
  color: var(--danger);
}

.toast.fadeout {
  animation: toastOut .3s ease forwards;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(60px) scale(.9);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes toastOut {
  from {
    opacity: 1;
    transform: none;
  }

  to {
    opacity: 0;
    transform: translateX(60px) scale(.9);
  }
}

/* ---- MODAL ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  background: rgba(0, 0, 0, .55);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(.94) translateY(20px);
  transition: transform var(--transition);
}

.modal-overlay.open .modal {
  transform: none;
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-6);
  border-bottom: 1px solid var(--gray-4);
  position: sticky;
  top: 0;
  background: var(--white);
  z-index: 1;
}

.modal__title {
  font-size: 1.1rem;
  font-weight: 700;
}

.modal__close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-1);
  transition: all var(--transition);
  cursor: pointer;
}

.modal__close:hover {
  background: var(--gray-5);
  color: var(--dark);
}

.modal__body {
  padding: var(--space-6);
}

/* ---- FORM ELEMENTS ---- */
.form-group {
  margin-bottom: var(--space-4);
}

.form-label {
  display: block;
  font-size: .87rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--dark-2);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--gray-3);
  border-radius: var(--radius);
  font-size: .95rem;
  color: var(--dark);
  transition: border-color var(--transition), box-shadow var(--transition);
  background: var(--white);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(227, 28, 28, .1);
}

.form-input::placeholder {
  color: var(--gray-2);
}

.form-select {
  appearance: none;
  cursor: pointer;
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
}

.input-with-icon {
  position: relative;
}

.input-with-icon .form-input {
  padding-left: 42px;
}

.input-with-icon .input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-2);
  font-size: .95rem;
  pointer-events: none;
}

/* ---- PAGINATION ---- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: var(--space-8) 0;
}

.page-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid var(--gray-3);
  color: var(--gray-1);
  transition: all var(--transition);
}

.page-btn:hover,
.page-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--white);
}

/* ---- PROGRESS BAR ---- */
.progress-bar-wrap {
  background: var(--gray-4);
  border-radius: var(--radius-full);
  height: 6px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--primary);
  transition: width .5s ease;
}

/* ---- EMPTY STATE ---- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-16) var(--space-4);
  text-align: center;
}

.empty-state i {
  font-size: 4rem;
  color: var(--gray-3);
  margin-bottom: var(--space-4);
}

.empty-state h3 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: var(--space-2);
}

.empty-state p {
  color: var(--gray-1);
  margin-bottom: var(--space-6);
}

/* ---- SCROLLBAR ---- */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--gray-5);
}

::-webkit-scrollbar-thumb {
  background: var(--gray-3);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--gray-2);
}

/* ---- DIVIDER ---- */
.divider {
  border: none;
  border-top: 1px solid var(--gray-4);
  margin: var(--space-6) 0;
}

/* ---- RESPONSIVE HELPERS ---- */
.hide-mobile {
  display: block;
}

.show-mobile {
  display: none;
}

@media (max-width: 768px) {
  .hide-mobile {
    display: none !important;
  }

  .show-mobile {
    display: block !important;
  }

  .page-wrapper {
    padding-top: var(--space-3);
  }

  .section {
    padding: var(--space-8) 0;
  }

  .container {
    padding: 0 var(--space-3);
  }
}/* ---- GLOBAL PRODUCT GRIDS ---- */
.product-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
}
@media (max-width: 992px) {
  .product-grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 576px) {
  .product-grid-3 {
    grid-template-columns: 1fr;
  }
}
