/* ================================
   COMPONENTES HEADER, FOOTER, CART E PRODUCT
   Design System Violeta Visionária
   ================================ */

/* ================= HEADER COMPONENT ================= */

.sv-shell {
  font-family: "Poppins", system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial;
}

.sv-shell * {
  box-sizing: border-box;
}

/* Header Navigation */
.sv-shell .sv-nav-wrap {
  background: var(--background);
  background-image:
    radial-gradient(600px 220px at 10% 0%, rgba(160, 74, 217, .06), transparent 60%),
    radial-gradient(500px 200px at 90% 100%, rgba(180, 128, 229, .06), transparent 60%);
  position: sticky;
  top: 0;
  z-index: 999;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 8px 32px rgba(34, 31, 40, .15);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.sv-shell .navbar-custom {
  background: transparent;
}

/* Logo */
.sv-shell .navbar-brand img {
  height: 58px;
  width: auto;
  max-width: 200px;
  display: block;
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, .45));
}

@media (max-width: 576px) {
  .sv-shell .navbar-brand img {
    height: 60px;
    max-width: 180px;
  }
}

/* Navigation Links */
.sv-shell .navbar-custom .nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  color: var(--primary) !important;
  font-weight: 600;
  letter-spacing: .35px;
  text-transform: uppercase;
  padding: 10px 14px !important;
  font-size: .98rem;
  transition: color .15s ease, transform .15s ease;
}

.sv-shell .navbar-custom .nav-link i {
  margin: 0 !important;
  line-height: 1;
  flex: 0 0 auto;
  display: inline-block;
}

.sv-shell .navbar-custom .nav-link:hover {
  color: var(--accent) !important;
  transform: translateY(-1px);
}

.sv-shell .navbar-custom .nav-link::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 4px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--primary), var(--accent) 45%, var(--tertiary));
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .18s ease, transform .18s ease;
}

.sv-shell .navbar-custom .nav-link:hover::after,
.sv-shell .navbar-custom .nav-link.active::after {
  opacity: 1;
  transform: translateY(0);
}

/* Buttons */
.sv-shell .btn-gold {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--primary-foreground);
  text-decoration: none;
  font-weight: 700;
  border: 1px solid var(--primary-alpha);
  background: linear-gradient(135deg, var(--primary), var(--accent) 50%, var(--tertiary));
  box-shadow: var(--glow);
  transition: transform .15s ease, box-shadow .2s ease, filter .2s ease;
}

.sv-shell .btn-gold:hover {
  transform: translateY(-2px);
  box-shadow: var(--glow-strong);
  filter: saturate(105%);
}

.sv-shell .btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--foreground);
  font-weight: 700;
  text-decoration: none;
  border: 1px dashed var(--border);
  background: transparent;
  transition: background .2s ease, transform .15s ease;
}

.sv-shell .btn-ghost:hover {
  background: var(--primary-alpha-light);
  color: var(--primary);
  transform: translateY(-2px);
}

.sv-shell .user-greeting {
  font-size: .92rem;
  color: var(--muted-foreground);
  margin-bottom: 4px;
  text-align: right;
}

.sv-shell #svCarrinhoBtn .badge {
  font-size: .78rem;
  top: 6px !important;
  right: 0 !important;
}

/* Cart Tooltip */
.sv-shell #svTooltipCarrinho,
.sv-shell #svTooltipCarrinhoDesktop {
  min-width: 260px;
  max-width: 360px;
  z-index: 1000;
  display: none;
  top: 115%;
  right: 0;
  color: var(--foreground);
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px;
  box-shadow: 0 18px 36px rgba(34, 31, 40, .25), 0 0 0 1px var(--primary-alpha-light) inset;
  font-size: .98rem;
  animation: svTooltipFade .16s ease-out;
}

@keyframes svTooltipFade {
  0% {
    opacity: 0;
    transform: translateY(-5px);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Mobile Toggler */
.sv-shell .navbar-toggler {
  border: none;
  outline: none;
  background: transparent;
}

.sv-shell .navbar-toggler:focus {
  box-shadow: none;
}

.sv-shell .navbar-toggler .navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 30 22' xmlns='http://www.w3.org/2000/svg'%3E%3Cg stroke='%23a04ad9' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M3 3h24'/%3E%3Cpath d='M3 11h24'/%3E%3Cpath d='M3 19h24'/%3E%3C/g%3E%3C/svg%3E");
  width: 30px;
  height: 22px;
}

/* Top Bar Layout */
.sv-shell .sv-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 10px;
}

.sv-shell .sv-top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Department Card */
.sv-shell .sv-dept-card {
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  margin-top: 12px;
  box-shadow: var(--glow);
  width: min(420px, 92vw);
  display: none;
  z-index: 1001;
}

.sv-shell .sv-dept-card h6 {
  color: var(--primary);
  font-weight: 700;
  letter-spacing: .35px;
  text-transform: uppercase;
  font-size: .92rem;
  margin: 0 0 8px 2px;
}

.sv-shell .sv-cat-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sv-shell .sv-cat-grid a {
  color: var(--foreground);
  border-radius: 10px;
  padding: 10px 12px;
  letter-spacing: .2px;
  text-decoration: none;
  display: block;
  transition: background .15s ease, color .15s ease, transform .15s ease;
}

.sv-shell .sv-cat-grid a:hover {
  background: var(--primary-alpha-light);
  color: var(--primary);
  transform: translateX(2px);
}

/* Mobile Actions */
.sv-shell .sv-actions-mobile .btn-gold,
.sv-shell .sv-actions-mobile .btn-ghost {
  width: 100%;
  justify-content: center;
}

/* Banner Full-bleed */
.sv-shell .sv-banner-fullbleed-wrap {
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  width: 100vw;
  margin-top: 0 !important;
  background: var(--bg-grad);
}

.sv-shell .sv-banner-carousel {
  width: 100vw;
  margin: 0;
  border-radius: 0 !important;
  box-shadow: none !important;
}

.sv-shell .sv-banner-carousel .carousel-inner {
  border-radius: 0 !important;
}

.sv-shell .sv-banner-img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
  border-radius: 0 !important;
}

.sv-shell .sv-banner-carousel .carousel-control-prev-icon,
.sv-shell .sv-banner-carousel .carousel-control-next-icon {
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .6));
}

.sv-shell .sv-banner-carousel .carousel-control-prev,
.sv-shell .sv-banner-carousel .carousel-control-next {
  opacity: .9;
  transition: opacity .2s ease;
}

.sv-shell .sv-banner-carousel .carousel-control-prev:hover,
.sv-shell .sv-banner-carousel .carousel-control-next:hover {
  opacity: 1;
}

/* Responsive */
@media (max-width: 992px) {
  .sv-shell .navbar-custom .navbar-collapse {
    background: var(--background);
    padding: 18px 12px;
    border-radius: 0 0 14px 14px;
    box-shadow: inset 0 1px 0 var(--border);
  }
}

@media (max-width: 768px) {
  .sv-shell .user-greeting {
    text-align: left;
  }
}

@media (min-width: 992px) {
  .sv-shell .sv-top-actions {
    display: none;
  }
}

/* ================= FOOTER COMPONENT ================= */

/* Top Divider */
.top-divider {
  height: 22px;
  width: 100%;
  background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 48%, var(--tertiary) 100%);
}

/* Footer Main */
.site-footer {
  background: var(--dark-surface);
  color: #eee;
  padding: 35px 0 0 0;
  position: relative;
}

.footer-logo {
  width: 180px;
  max-width: 95%;
  margin-bottom: 12px;
  filter: drop-shadow(0 6px 18px var(--primary-alpha));
}

.footer-text {
  font-size: 1.05rem;
  line-height: 1.6;
  color: #f1f1f1;
}

/* Footer Text Styles */
.violet {
  color: var(--accent) !important;
  font-weight: 700;
}

.violet-strong {
  color: var(--primary) !important;
  font-weight: 800;
}

.violet-mark {
  color: var(--primary-foreground);
  background: var(--primary);
  padding: 0 .25rem;
  border-radius: .25rem;
  font-weight: 800;
}

.footer-title {
  letter-spacing: 1px;
  color: var(--primary);
  font-weight: 800;
}

.footer-link {
  color: #fff;
  font-weight: 700;
  padding: .25rem 0;
  display: inline-block;
  transition: color .18s ease, transform .18s ease;
}

.footer-link:hover {
  color: var(--accent);
  transform: translateX(2px);
}

/* Social Icons */
.social {
  display: flex;
  gap: .75rem;
}

.social-link {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  text-decoration: none;
  border: 1px solid var(--primary-alpha);
  border-radius: 10px;
  transition: transform .15s ease, background .2s ease, color .2s ease, box-shadow .2s ease;
  box-shadow: var(--shadow-light);
  background: rgba(255, 255, 255, .02);
}

.social-link:hover {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: var(--primary-foreground);
  transform: translateY(-2px);
  box-shadow: var(--shadow-strong);
}

/* Footer Slider */
.footer-slider {
  margin: 0 auto 18px auto;
  max-width: 100%;
  overflow: hidden;
  background: var(--dark-surface);
  border-radius: 10px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-light);
}

.footer-slider-track {
  gap: 32px;
  padding: 12px;
}

.footer-slider-track img,
.footer-slider-track video {
  height: 38px;
  max-width: 140px;
  border-radius: 7px;
  background: #fff;
  object-fit: contain;
  box-shadow: 0 1px 6px rgba(0, 0, 0, .15);
  margin: 0 10px;
  border: 1px solid var(--border);
}

/* Footer Dividers */
.footer-divider {
  border-top: 1px solid var(--primary-alpha-light);
}

.powered a {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

/* Footer Responsive */
@media (max-width: 768px) {

  .footer-slider-track img,
  .footer-slider-track video {
    height: 28px;
  }

  .col-lg-4 {
    margin-bottom: 24px;
  }

  .social-link {
    width: 40px;
    height: 40px;
  }
}

/* ================= CART COMPONENT ================= */

.cart-container {
  background: var(--background);
}

.card-modern {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 8px);
  box-shadow: 0 6px 24px rgba(34, 31, 40, 0.06);
}

.item-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
}

.cart-thumb {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: var(--radius);
  background: var(--muted);
}

.cart-price {
  font-weight: 700;
  color: var(--foreground);
}

.cart-price-old {
  text-decoration: line-through;
  color: var(--muted-foreground);
  opacity: 0.7;
  font-weight: 500;
}

.cart-badge-flag {
  display: inline-block;
  padding: .25rem .5rem;
  border-radius: 999px;
  font-size: .75rem;
  background: var(--accent);
  color: var(--accent-foreground);
  border: 1px solid var(--accent);
}

.cart-qty {
  width: 50px;
  text-align: center;
}

.cart-summary {
  position: sticky;
  top: 24px;
}

.cart-progress-min {
  height: 8px;
  background: var(--muted);
  border-radius: 999px;
  overflow: hidden;
}

.cart-progress-min>div {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

.cart-mini {
  color: var(--muted-foreground);
  font-size: .9rem;
}

.cart-alert-modern {
  border: 1px dashed var(--border);
  background: var(--card);
  color: var(--destructive);
  border-radius: var(--radius);
}

.cart-disabled-note {
  color: var(--destructive);
  font-size: .9rem;
}

/* ================= PRODUCT COMPONENT ================= */

body.modal-open {
  overflow: hidden;
  touch-action: none;
}

.product-wrap {
  padding: 2rem 0;
  background: var(--background);
}

.product-wrap.container {
  padding-left: 1rem;
  padding-right: 1rem;
}

.product-wrap .row>* {
  min-width: 0;
}

.product-wrap img,
.product-wrap video {
  max-width: 100%;
  height: auto;
  display: block;
}

.break-anywhere,
.breadcrumb-small,
.product-wrap .text-secondary,
.product-wrap h1,
.product-wrap .price {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.gallery-main {
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: cover;
  background: var(--card);
  border-radius: calc(var(--radius) + 4px);
  border: 1px solid var(--border);
  cursor: zoom-in;
}

.thumb {
  flex: 0 0 auto;
  width: 78px;
  height: 78px;
  object-fit: cover;
  border-radius: var(--radius);
  border: 2px solid transparent;
  cursor: pointer;
  background: var(--card);
  transition: border-color .15s, transform .15s;
}

.thumb:hover {
  transform: translateY(-1px);
}

.thumb.active {
  border-color: var(--primary);
}

.price {
  font-size: clamp(1.6rem, 2.5vw, 2.25rem);
  font-weight: 900;
  letter-spacing: .2px;
  color: var(--primary);
  line-height: 1;
}

.price-old {
  text-decoration: line-through;
  opacity: .7;
  margin-left: .6rem;
  color: var(--muted-foreground);
}

.badge-discount {
  background: var(--destructive);
}

.mini-badge {
  font-size: .75rem;
  vertical-align: middle;
}

.section-label {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-size: .9rem;
  color: var(--muted-foreground);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: .35rem;
}

.section-label .dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--primary);
  opacity: .35;
}

.variant-chip {
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--foreground);
  padding: .55rem .95rem;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  user-select: none;
  transition: box-shadow .15s, border-color .15s, background-color .15s;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.variant-chip:hover {
  border-color: var(--primary);
}

.variant-chip .check {
  display: none;
  font-weight: 700;
  line-height: 1;
  transform: translateY(-1px);
}

.variant-chip.active {
  border-color: var(--primary);
  background: var(--primary-alpha-light);
  box-shadow: 0 0 0 .15rem var(--primary-alpha);
  font-weight: 700;
}

.variant-chip.active .check {
  display: inline;
  color: var(--primary);
}

.variant-chip.disabled {
  opacity: .5;
  pointer-events: none;
  text-decoration: line-through;
  color: var(--muted-foreground);
}

.qty-input {
  width: 130px;
}

.related-card {
  border-radius: calc(var(--radius) + 4px);
  box-shadow: 0 6px 24px rgba(34, 31, 40, 0.06);
  border: 1px solid var(--border);
  overflow: hidden;
  background: var(--card);
  transition: transform .15s;
  max-width: 100%;
}

.related-card:hover {
  transform: translateY(-2px);
}

.related-card img {
  height: 180px;
  object-fit: cover;
  width: 100%;
  display: block;
}

.badge-atacado {
  background: var(--tertiary);
}

.stock-ok {
  color: var(--secondary);
}

.stock-low {
  color: var(--destructive);
}

.stock-out {
  color: var(--destructive);
}

.variant-chip:focus-visible,
.thumb:focus-visible,
.gm-btn:focus-visible {
  outline: 3px solid var(--primary-alpha);
  outline-offset: 2px;
}

/* Product Modal Gallery (Lightbox) */
.gm-root {
  position: fixed;
  inset: 0;
  z-index: 1050;
  display: none;
}

.gm-root.open {
  display: block;
}

.gm-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(26, 22, 37, .88);
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity .2s ease;
}

.gm-root.open .gm-backdrop {
  opacity: 1;
}

.gm-box {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 2.5rem;
}

.gm-stage {
  position: relative;
  max-width: 96vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--dark-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-strong);
  overflow: hidden;
}

.gm-image {
  max-width: 96vw;
  max-height: 90vh;
  width: auto;
  height: auto;
  display: block;
}

.gm-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  border-radius: 999px;
  height: 44px;
  width: 44px;
  background: rgba(255, 255, 255, .9);
  color: var(--foreground);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  line-height: 1;
  transition: background .15s ease, transform .15s ease;
  box-shadow: var(--shadow-light);
}

.gm-btn:hover {
  background: var(--card);
  transform: translateY(-50%) scale(1.05);
}

.gm-prev {
  left: .5rem;
}

.gm-next {
  right: .5rem;
}

.gm-close {
  position: absolute;
  top: .75rem;
  right: .75rem;
  border: none;
  background: rgba(255, 255, 255, .9);
  color: var(--foreground);
  height: 40px;
  width: 40px;
  border-radius: 999px;
  font-size: 20px;
  cursor: pointer;
  box-shadow: var(--shadow-light);
}

.gm-counter {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: .5rem;
  color: var(--primary-foreground);
  font-weight: 600;
  letter-spacing: .02em;
  background: rgba(26, 22, 37, .45);
  padding: .25rem .6rem;
  border-radius: .6rem;
  font-size: .9rem;
}

/* Product Responsive */
@media (max-width: 576px) {
  .product-wrap {
    padding: 1.25rem 0;
  }

  .thumb {
    width: 64px;
    height: 64px;
  }

  .qty-input {
    width: 120px;
  }

  .gm-box {
    padding: 2rem 1rem;
  }

  .gm-btn {
    height: 40px;
    width: 40px;
    font-size: 18px;
  }

  .gm-close {
    height: 36px;
    width: 36px;
    font-size: 18px;
  }
}