/*
 * Fargin design system
 * Global styles for the Fargin storefront. Component-specific styles live next to their components.
 *
 *  1. Tokens          6. Product cards        11. Checkout & orders
 *  2. Base            7. Carousels & tabs     12. Social / follow strip
 *  3. Controls        8. Product listing      13. Footer
 *  4. Layout          9. Product page         14. Responsive
 *  5. Header & nav   10. Reviews
 */

/* 1. Tokens ---------------------------------------------------------------------------------- */
:root {
  --fg-red: #D10024;
  --fg-red-dark: #A8001D;
  --fg-red-soft: #FDECEF;
  --fg-ink: #1A1C24;
  --fg-text: #3D4150;
  --fg-muted: #6B7080;
  --fg-line: #E6E8EE;
  --fg-bg: #F6F7F9;
  --fg-surface: #FFFFFF;
  --fg-star: #F5A524;
  --fg-success: #1E8E3E;

  --fg-radius-sm: 6px;
  --fg-radius: 10px;
  --fg-radius-lg: 14px;
  --fg-shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
  --fg-shadow: 0 4px 14px rgba(16, 24, 40, 0.08);
  --fg-shadow-lg: 0 12px 32px rgba(16, 24, 40, 0.14);
  --fg-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
}

/* 2. Base ------------------------------------------------------------------------------------ */
body {
  font-family: var(--fg-font);
  font-weight: 400;
  color: var(--fg-text);
  background-color: var(--fg-surface);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--fg-font);
  color: var(--fg-ink);
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 10px;
}

a {
  color: var(--fg-ink);
  font-weight: 500;
  transition: color 0.15s ease;
}

a:hover,
a:focus {
  color: var(--fg-red);
  text-decoration: none;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

img { max-width: 100%; }

/* Keyboard users always see where they are */
:focus-visible {
  outline: 2px solid var(--fg-red);
  outline-offset: 2px;
}

::selection { background: var(--fg-red-soft); color: var(--fg-ink); }

/* 3. Controls -------------------------------------------------------------------------------- */
.primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  background-color: var(--fg-red);
  border: 1px solid var(--fg-red);
  border-radius: var(--fg-radius-sm);
  color: #FFF;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.primary-btn:hover,
.primary-btn:focus {
  background-color: var(--fg-red-dark);
  border-color: var(--fg-red-dark);
  color: #FFF;
  box-shadow: 0 4px 12px rgba(209, 0, 36, 0.25);
}

.primary-btn:disabled { opacity: 0.6; cursor: not-allowed; box-shadow: none; }

.input,
.input-select {
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--fg-line);
  border-radius: var(--fg-radius-sm);
  background-color: var(--fg-surface);
  color: var(--fg-ink);
  font-size: 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input { width: 100%; }

textarea.input {
  padding: 12px 14px;
  min-height: 96px;
  height: auto;
}

.input:focus,
.input-select:focus {
  outline: none;
  border-color: var(--fg-red);
  box-shadow: 0 0 0 3px rgba(209, 0, 36, 0.12);
}

/* 4. Layout ---------------------------------------------------------------------------------- */
.section {
  padding-top: 32px;
  padding-bottom: 32px;
}

.section-title {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin: 8px 0 24px;
}

.section-title .title {
  display: inline-block;
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.01em;
}

.section-title .section-nav { display: flex; align-items: center; gap: 16px; }

.section-tab-nav { display: flex; flex-wrap: wrap; gap: 6px; }

.section-tab-nav li a {
  display: block;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--fg-muted);
  background: var(--fg-bg);
}

.section-tab-nav li a:hover { color: var(--fg-ink); }

.section-tab-nav li.active a {
  color: #FFF;
  background: var(--fg-red);
}

/* 5. Header & nav ---------------------------------------------------------------------------- */
#top-header {
  padding: 8px 0;
  background-color: var(--fg-bg);
  border-bottom: 1px solid var(--fg-line);
}

.header-links li {
  display: inline-block;
  margin-right: 18px;
  font-size: 12px;
  color: var(--fg-muted);
}

.header-links li:last-child { margin-right: 0; }
.header-links li a { color: var(--fg-text); font-weight: 500; }
.header-links li a:hover { color: var(--fg-red); }
.header-links li i { color: var(--fg-red); margin-right: 6px; }

#header {
  padding: 14px 0;
  background-color: var(--fg-surface);
  border-bottom: 1px solid var(--fg-line);
}

#header .row {
  display: flex;
  align-items: center;
}

#header .col-md-3 { flex: 0 0 auto; }
#header .col-md-6 { flex: 1 1 auto; }

.header-logo .logo { display: inline-block; }
.header-logo .logo img { display: block; }

.header-ctn {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

/* Header icon buttons (Quote, Orders, Cart, Account) */
#header .compact-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 4px;
}

#header .compact-item {
  position: relative;
  min-width: 52px;
  height: 52px;
  padding: 0 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--fg-radius-sm);
  background: transparent;
}

#header .compact-item:hover { background: var(--fg-bg); }

#header .compact-item > a,
#header .compact-item > button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: 100%;
  height: 100%;
  border: none;
  background: transparent;
  color: var(--fg-ink);
  cursor: pointer;
}

#header .compact-item > a:hover,
#header .compact-item > button:hover { color: var(--fg-red); }

#header .compact-item i { font-size: 19px; color: inherit; margin: 0; }

#header .compact-item .nav-label {
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
  color: inherit;
}

#header .compact-item .qty {
  position: absolute;
  top: 4px;
  right: 6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  line-height: 18px;
  border-radius: 999px;
  background: var(--fg-red);
  color: #FFF;
  font-size: 10px;
  font-weight: 700;
  text-align: center;
}

/* Mini cart (header dropdown) */
.cart-dropdown {
  position: absolute;
  right: 0;
  width: 320px;
  padding: 16px;
  background: var(--fg-surface);
  border: 1px solid var(--fg-line);
  border-radius: var(--fg-radius);
  box-shadow: var(--fg-shadow-lg);
  z-index: 99;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
}

.dropdown.open > .cart-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.cart-dropdown .cart-list {
  max-height: 220px;
  overflow-y: auto;
  margin-bottom: 12px;
}

.cart-dropdown .cart-btns {
  display: flex;
  gap: 8px;
}

.cart-dropdown .cart-btns > a {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 12px;
  border-radius: var(--fg-radius-sm);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  background: var(--fg-red);
  color: #FFF;
}

.cart-dropdown .cart-btns > a:first-child {
  background: var(--fg-surface);
  color: var(--fg-ink);
  border: 1px solid var(--fg-line);
}

.cart-dropdown .cart-btns > a:hover { background: var(--fg-red-dark); color: #FFF; }
.cart-dropdown .cart-btns > a:first-child:hover { background: var(--fg-bg); color: var(--fg-ink); }

/* Small product row (mini cart) */
.product-widget {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 28px 8px 0;
}

.product-widget + .product-widget { border-top: 1px solid var(--fg-line); }

.product-widget .product-img {
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
  border-radius: var(--fg-radius-sm);
  background: var(--fg-bg);
  overflow: hidden;
}

.product-widget .product-img > img { width: 100%; height: 100%; object-fit: contain; }
.product-widget .product-body { min-width: 0; }

.product-widget .product-body .product-name {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
}

.product-widget .product-body .product-price {
  margin: 0;
  font-size: 14px;
  color: var(--fg-ink);
}

.product-widget .product-body .product-price .qty {
  margin-right: 8px;
  font-weight: 400;
  color: var(--fg-muted);
}

.product-widget .delete {
  position: absolute;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--fg-bg);
  color: var(--fg-muted);
  font-size: 11px;
  cursor: pointer;
}

.product-widget .delete:hover { background: var(--fg-red-soft); color: var(--fg-red); }

/* Main navigation bar */
#navigation {
  background: var(--fg-surface);
  border-bottom: 1px solid var(--fg-line);
}

.main-nav > li + li { margin-left: 26px; }

.main-nav > li > a {
  position: relative;
  padding: 16px 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--fg-text);
}

.main-nav > li > a:hover,
.main-nav > li > a:focus,
.main-nav > li.active > a {
  color: var(--fg-red);
  background-color: transparent;
}

.main-nav > li > a:after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background-color: var(--fg-red);
  transform: scaleX(0);
  transition: transform 0.2s ease;
}

.main-nav > li > a:hover:after,
.main-nav > li > a:focus:after,
.main-nav > li.active > a:after { transform: scaleX(1); }

/* 6. Product cards --------------------------------------------------------------------------- */
.product {
  position: relative;
  margin: 12px 0;
  background: var(--fg-surface);
  border: 1px solid var(--fg-line);
  border-radius: var(--fg-radius);
  overflow: hidden;
  transition: box-shadow 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.product:hover {
  border-color: transparent;
  box-shadow: var(--fg-shadow);
  transform: translateY(-2px);
}

.product .product-img {
  position: relative;
  display: block;
  width: 100%;
  background: var(--fg-bg);
  overflow: hidden;
  cursor: pointer;
}

.product .product-img > img {
  display: block;
  width: 100%;
  transition: transform 0.3s ease;
}

.product:hover .product-img > img { transform: scale(1.04); }

.product .product-img .product-label {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  display: flex;
  gap: 6px;
}

.product .product-img .product-label > span {
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.product .product-img .product-label > span.new { background: var(--fg-ink); color: #FFF; }
.product .product-img .product-label > span.sale { background: var(--fg-red); color: #FFF; }

.product .product-body {
  position: relative;
  padding: 14px 14px 10px;
  text-align: left;
}

.product .product-body .product-category {
  margin: 0 0 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

.product .product-body .product-name {
  margin: 0 0 8px;
  min-height: 38px;
  font-size: 14px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product .product-body .product-name > a,
.product .product-body .product-name > span {
  font-weight: 600;
  color: var(--fg-ink);
}

.product .product-body .product-name > a:hover,
.product .product-body .product-name > span:hover { color: var(--fg-red); }

.product .product-body .product-price {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--fg-red);
}

.product .product-body .product-price .product-old-price,
.product-old-price {
  margin-left: 8px;
  font-size: 13px;
  font-weight: 400;
  color: var(--fg-muted);
  text-decoration: line-through;
}

.product .product-body .product-rating {
  margin: 0 0 6px;
  font-size: 12px;
  color: var(--fg-line);
}

.product .product-body .product-rating > i { margin-right: 1px; color: #D5D8E0; }
.product .product-body .product-rating > i.fa-star { color: var(--fg-star); }

.product .product-body .product-btns {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.product .product-body .product-btns > button {
  position: relative;
  width: 34px;
  height: 34px;
  border: 1px solid var(--fg-line);
  border-radius: 50%;
  background: var(--fg-surface);
  color: var(--fg-muted);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.product .product-body .product-btns > button:hover { color: var(--fg-red); border-color: var(--fg-red); }

/* Hover hint on icon buttons */
.product .product-body .product-btns > button .tooltipp {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  padding: 5px 8px;
  border-radius: 4px;
  background: var(--fg-ink);
  color: #FFF;
  font-size: 11px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.product .product-body .product-btns > button:hover .tooltipp { opacity: 1; visibility: visible; }

/* Add to cart: always visible at the bottom of the card */
.product .add-to-cart { padding: 0 14px 14px; }

.product .add-to-cart .add-to-cart-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 40px;
  padding: 0 14px;
  border: 1px solid var(--fg-red);
  border-radius: var(--fg-radius-sm);
  background: var(--fg-surface);
  color: var(--fg-red);
  font-size: 13px;
  font-weight: 600;
  text-transform: capitalize;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.product .add-to-cart .add-to-cart-btn:hover,
.product .add-to-cart .add-to-cart-btn:focus {
  background: var(--fg-red);
  color: #FFF;
}

/* 7. Carousels & tabs ------------------------------------------------------------------------ */
.products-slick .slick-list { margin: 0 -8px; }
.products-slick .product.slick-slide { margin: 12px 8px; }

.products-tabs > .tab-pane {
  display: block;
  height: 0;
  opacity: 0;
  visibility: hidden;
  overflow: hidden;
}

.products-tabs > .tab-pane.active {
  height: auto;
  opacity: 1;
  visibility: visible;
  overflow: visible;
}

.products-slick-nav {
  display: flex;
  gap: 6px;
  z-index: 10;
}

.products-slick-nav .slick-prev,
.products-slick-nav .slick-next {
  position: static;
  transform: none;
  width: 34px;
  height: 34px;
  border: 1px solid var(--fg-line);
  border-radius: 50%;
  background: var(--fg-surface);
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
}

.products-slick-nav .slick-prev:hover,
.products-slick-nav .slick-next:hover { border-color: var(--fg-red); }

.products-slick-nav .slick-prev:before,
.products-slick-nav .slick-next:before {
  font-family: FontAwesome;
  font-size: 14px;
  color: var(--fg-ink);
  opacity: 1;
}

.products-slick-nav .slick-prev:before { content: "\f104"; }
.products-slick-nav .slick-next:before { content: "\f105"; }

/* 8. Product listing ------------------------------------------------------------------------- */
.store-filter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin: 8px 0 16px;
  padding: 12px 14px;
  background: var(--fg-bg);
  border-radius: var(--fg-radius);
}

.store-sort label {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--fg-text);
}

.store-sort .input-select { height: 34px; margin-left: 6px; font-weight: 500; }

.store-grid { display: flex; gap: 6px; }

.store-grid li a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--fg-line);
  border-radius: var(--fg-radius-sm);
  background: var(--fg-surface);
  color: var(--fg-muted);
}

.store-grid li a:hover { color: var(--fg-ink); }

.store-grid li.active a {
  background: var(--fg-red);
  border-color: var(--fg-red);
  color: #FFF;
}

/* 9. Product page ---------------------------------------------------------------------------- */
.product-details .product-name { font-size: 22px; }
.product-details .product-rating > i { color: #D5D8E0; }
.product-details .product-rating > i.fa-star { color: var(--fg-star); }

.product-details .product-price {
  font-size: 26px;
  font-weight: 700;
  color: var(--fg-red);
}

/* 10. Reviews -------------------------------------------------------------------------------- */
.rating .rating-stars,
.rating-avg .rating-stars { display: inline-block; }

.rating .rating-stars > i,
.rating-avg .rating-stars > i { color: #D5D8E0; }

.rating .rating-stars > i.fa-star,
.rating-avg .rating-stars > i.fa-star { color: var(--fg-star); }

.rating li { margin: 5px 0; }

.rating .rating-progress {
  position: relative;
  display: inline-block;
  width: 120px;
  height: 8px;
  margin: 0 10px;
  border-radius: 999px;
  background: var(--fg-line);
  overflow: hidden;
}

.rating .rating-progress > div {
  position: absolute;
  inset: 0 auto 0 0;
  background: var(--fg-star);
  border-radius: 999px;
}

.rating .sum { font-size: 12px; color: var(--fg-muted); }

.reviews li {
  padding: 16px 0;
  border-bottom: 1px solid var(--fg-line);
}

.reviews .review-heading .name { margin: 0 0 2px; font-size: 14px; }
.reviews .review-heading .date { margin: 0; font-size: 12px; color: var(--fg-muted); }
.reviews .review-heading .review-rating > i { color: #D5D8E0; }
.reviews .review-heading .review-rating > i.fa-star { color: var(--fg-star); }
.reviews .review-body { margin-top: 8px; }

.review-form .input { margin-bottom: 14px; }
.review-form .input-rating { margin-bottom: 14px; }
.review-form .input-rating .stars { display: inline-block; vertical-align: top; }
.review-form .input-rating .stars input[type="radio"] { display: none; }

.review-form .input-rating .stars > label {
  float: right;
  margin: 0;
  padding: 0 3px;
  cursor: pointer;
}

.review-form .input-rating .stars > label:before {
  content: "\f006";
  font-family: FontAwesome;
  font-size: 18px;
  color: #D5D8E0;
  transition: color 0.15s ease;
}

.review-form .input-rating .stars > label:hover:before,
.review-form .input-rating .stars > label:hover ~ label:before,
.review-form .input-rating .stars > input:checked ~ label:before {
  content: "\f005";
  color: var(--fg-star);
}

/* 11. Checkout & orders ---------------------------------------------------------------------- */
.billing-details { margin-bottom: 30px; }
.order-summary { margin: 16px 0; }

.order-summary .order-col {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--fg-line);
}

.order-summary .order-col > div:last-child { text-align: right; }
.order-summary .order-col .order-total { font-size: 22px; font-weight: 700; color: var(--fg-red); }

/* 12. Social / follow strip ------------------------------------------------------------------ */
#newsletter.section {
  margin-top: 32px;
  background: var(--fg-bg);
  border-top: 1px solid var(--fg-line);
}

.newsletter { text-align: center; }
.newsletter p { margin-bottom: 16px; font-size: 18px; color: var(--fg-ink); }

.newsletter .newsletter-follow {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.newsletter .newsletter-follow li a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--fg-line);
  border-radius: 50%;
  background: var(--fg-surface);
  color: var(--fg-ink);
  font-size: 18px;
}

.newsletter .newsletter-follow li a:hover { border-color: var(--fg-red); color: var(--fg-red); }

/* 13. Footer --------------------------------------------------------------------------------- */
#footer {
  background: var(--fg-ink);
  color: #A9ADBA;
}

#bottom-footer {
  padding: 20px 0;
  background: #12141A;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.footer { margin: 32px 0; }

.footer .footer-title {
  margin: 0 0 18px;
  font-size: 15px;
  color: #FFF;
}

.footer p { color: #A9ADBA; line-height: 1.6; }
.footer-links li + li { margin-top: 10px; }
.footer-links li a,
.footer-links li span { color: #A9ADBA; font-weight: 400; font-size: 14px; }
.footer-links li a:hover { color: #FFF; }

.footer-links li i {
  width: 16px;
  margin-right: 10px;
  color: var(--fg-red);
  text-align: center;
}

.copyright {
  display: block;
  margin-top: 14px;
  font-size: 13px;
  color: #80859A;
}

.footer-pay-methods {
  margin: 0 0 8px;
  font-size: 14px;
  color: #A9ADBA;
}

/* 13b. Badges (Pro seller, Fargin Plus, priority orders) ------------------------------------ */
.fg-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.6;
  letter-spacing: 0.02em;
  white-space: nowrap;
  vertical-align: middle;
}
.fg-badge-pro { color: #1565C0; background: #E3F0FD; }
.fg-badge-plus { color: #FFF; background: linear-gradient(135deg, var(--fg-red) 0%, var(--fg-red-dark) 100%); }
.fg-badge-priority { color: #B26A00; background: #FFF4E0; text-transform: uppercase; }
.product .product-img .product-label > span.pro { background: #1565C0; color: #FFF; }
.header-plus-badge { margin-left: 4px; padding: 1px 6px; font-size: 10px; }

/* 14. Responsive ----------------------------------------------------------------------------- */
@media only screen and (max-width: 991px) {
  .header-logo { text-align: left; }
}

@media only screen and (max-width: 767px) {
  .section { padding-top: 22px; padding-bottom: 22px; }
  .section-title { margin-bottom: 16px; }
  .section-title .title { font-size: 18px; }
  .footer { margin: 22px 0; }
}
