/**
 * Shop Design System — Components CSS
 * Estilos Universais dos Componentes UI Reutilizáveis
 */

/* 1. Cards de Produtos Universais (ProductCard) */
.s-product-card {
    background: var(--s-color-bg-surface);
    border: 1px solid var(--s-color-border);
    border-radius: var(--s-radius-lg);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    transition: var(--s-transition-base);
}

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

.s-product-badge {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    background: var(--s-color-accent);
    color: var(--s-color-text-inverse);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.6rem;
    border-radius: var(--s-radius-pill);
    z-index: 2;
}

.s-product-fav-btn {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--s-color-bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--s-color-text-muted);
    transition: var(--s-transition-fast);
    z-index: 2;
}

.s-product-fav-btn:hover, .s-product-fav-btn.is-active {
    background: #fee2e2;
    color: var(--s-color-accent);
}

.s-product-img-box {
    width: 100%;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    overflow: hidden;
}

.s-product-img-box img {
    max-height: 100%;
    object-fit: contain;
    transition: var(--s-transition-base);
}

.s-product-card:hover .s-product-img-box img {
    transform: scale(1.05);
}

.s-product-rating {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.8rem;
    color: #f59e0b;
    margin-bottom: 0.5rem;
}

.s-product-rating span {
    color: var(--s-color-text-muted);
    font-size: 0.78rem;
    margin-left: 0.25rem;
}

.s-product-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--s-color-text-main);
    line-height: 1.35;
    margin-bottom: 0.75rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 2.7rem;
}

.s-product-price-box {
    margin-bottom: 1rem;
}

.s-product-old-price {
    font-size: 0.82rem;
    color: var(--s-color-text-muted);
    text-decoration: line-through;
    display: block;
}

.s-product-price {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--s-color-primary);
}

.s-btn-buy {
    width: 100%;
    padding: 0.65rem 1rem;
    background: var(--s-color-secondary);
    color: var(--s-color-text-inverse);
    border-radius: var(--s-radius-pill);
    font-weight: 700;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: var(--s-transition-fast);
}

.s-btn-buy:hover {
    background: var(--s-color-secondary-hover);
}

/* 2. Cards de Categorias (CategoryCard) */
.s-category-card {
    background: var(--s-color-bg-surface);
    border: 1px solid var(--s-color-border);
    border-radius: var(--s-radius-lg);
    padding: 1.25rem 1rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: var(--s-transition-base);
}

.s-category-card:hover {
    border-color: var(--s-color-secondary);
    box-shadow: var(--s-shadow-md);
    transform: translateY(-2px);
}

.s-category-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--s-color-bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--s-color-primary);
    margin-bottom: 0.75rem;
}

.s-category-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--s-color-text-main);
}

/* 3. Drawer Lateral do Carrinho (CartDrawer) */
.s-drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: var(--s-transition-base);
}

.s-drawer-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

.s-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 440px;
    max-width: 90vw;
    height: 100vh;
    background: var(--s-color-bg-surface);
    box-shadow: var(--s-shadow-lg);
    z-index: 9999;
    transform: translateX(100%);
    transition: var(--s-transition-base);
    display: flex;
    flex-direction: column;
}

.s-drawer.is-open {
    transform: translateX(0);
}

.s-drawer-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--s-color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.s-drawer-title {
    font-size: 1.25rem;
    font-weight: 800;
    margin: 0;
}

.s-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.s-drawer-footer {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--s-color-border);
    background: var(--s-color-bg-light);
}

/* ==========================================================================
   Vitrines (Showcase) — 3 modelos em carrossel
   ========================================================================== */
.showcase-section {
    padding: 2rem 0;
}
.showcase-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}
.showcase-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: #1e293b;
    margin: 0;
    line-height: 1.2;
}
.showcase-seeall {
    flex: 0 0 auto;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--color-primary, #007791);
    text-decoration: none;
    white-space: nowrap;
}
.showcase-seeall:hover { text-decoration: underline; }

/* Banner horizontal (modelo banner_top) — largo e baixo, como um banner de topo */
.showcase-topbanner {
    display: block;
    position: relative;
    margin-bottom: 1.5rem;
    border-radius: 14px;
    overflow: hidden;
    aspect-ratio: 5.6 / 1;
    text-decoration: none;
}
.showcase-topbanner img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}
/* Precisa da mesma especificidade de ".showcase-topbanner img" pra realmente
   esconder — só ".showcase-topbanner-mobile" sozinho perde a queda de braço
   e a imagem mobile fica visível por cima da desktop. */
.showcase-topbanner img.showcase-topbanner-mobile { display: none; }
.showcase-topbanner-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
}
.showcase-topbanner-body {
    position: relative;
    z-index: 2;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 0.9rem;
    padding: 1.5rem 2.5rem;
}
.showcase-topbanner-body h3 {
    font-size: 1.6rem;
    font-weight: 800;
    margin: 0;
    text-shadow: 0 1px 6px rgba(0,0,0,.25);
    max-width: 60%;
}
.showcase-topbanner-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    font-weight: 700;
    padding: 0.5rem 1.1rem;
    border-radius: 9999px;
}
@media (max-width: 768px) {
    .showcase-topbanner { aspect-ratio: 2.2 / 1; }
    .showcase-topbanner img.showcase-topbanner-desktop { display: none; }
    .showcase-topbanner img.showcase-topbanner-mobile { display: block; }
    .showcase-topbanner-body { padding: 1rem 1.25rem; gap: 0.6rem; }
    .showcase-topbanner-body h3 { font-size: 1.05rem; max-width: 80%; }
}

/* Trilho do carrossel */
.showcase-carousel { position: relative; }
.showcase-carousel-row {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 1rem;
    overflow-x: auto;
    scroll-behavior: smooth !important;
    scroll-snap-type: x proximity;
    padding: 0.25rem 0.25rem 0.5rem;
    margin: -0.25rem -0.25rem 0;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
.showcase-carousel-row::-webkit-scrollbar { display: none; }

/* Setas flutuantes no hover do carrossel das Vitrines Ultimate */
.showcase-carousel .showcase-side-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #334155;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, transform 0.2s ease, background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.showcase-carousel:hover .showcase-side-arrow {
    opacity: 1;
    visibility: visible;
}
.showcase-side-arrow.prev {
    left: -18px;
}
.showcase-side-arrow.next {
    right: -18px;
}
.showcase-side-arrow:hover:not(:disabled) {
    background: var(--color-primary, #007791) !important;
    border-color: var(--color-primary, #007791) !important;
    color: #ffffff !important;
    transform: translateY(-50%) scale(1.1);
}
.showcase-side-arrow:disabled {
    opacity: 0 !important;
    cursor: default;
    pointer-events: none;
}
@media (max-width: 768px) {
    .showcase-carousel .showcase-side-arrow {
        display: none !important;
    }
}

/* Card de produto */
.showcase-card {
    flex: 0 0 calc((100% - (var(--showcase-cols, 5) - 1) * 1rem) / var(--showcase-cols, 5));
    min-width: 0;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border: 1px solid #eef0f3;
    border-radius: 18px;
    padding: 1.1rem 1.1rem 1.5rem;
    position: relative;
    overflow: hidden;
    transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease;
}
.showcase-card:hover {
    border-color: #e2e8f0;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .08);
    transform: translateY(-2px);
}
.showcase-card::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 5px;
    background: var(--showcase-accent, #007791);
}

.showcase-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    min-height: 26px;
}
.showcase-badge {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-size: 0.74rem;
    font-weight: 800;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    line-height: 1.3;
}
.showcase-fav {
    width: 34px;
    height: 34px;
    border: 1.5px solid #e2e8f0;
    background: #fff;
    color: var(--showcase-accent, #007791);
    font-size: 1rem;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color .15s ease, background .15s ease, border-color .15s ease;
    margin-left: auto;
}
.showcase-fav:hover { background: #f1f5f9; border-color: #cbd5e1; }
.showcase-fav.is-active { color: #e11d48; border-color: #fecdd3; background: #fff1f2; }

.showcase-card-img {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 170px;
    margin: 0.35rem 0 0.75rem;
    overflow: hidden;
    position: relative;
}
.showcase-card-img::before {
    content: '';
    position: absolute;
    inset: 10%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0,119,145,.08), rgba(0,119,145,0) 72%);
    z-index: 0;
}
.showcase-card-img img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
    transition: transform .25s ease;
    position: relative;
    z-index: 1;
}
.showcase-card:hover .showcase-card-img img { transform: scale(1.05); }

.showcase-promo-tag {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    align-self: flex-start;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .02em;
    padding: 0.4rem 0.8rem;
    border-radius: 999px;
    margin-bottom: 0.65rem;
    line-height: 1.25;
}
.showcase-card-brand {
    font-size: 1.02rem;
    font-weight: 800;
    text-transform: uppercase;
    color: #0f172a;
    letter-spacing: .01em;
    margin-bottom: 0.2rem;
}
.showcase-card-name {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-transform: uppercase;
    font-size: calc(0.86rem - 2px);
    line-height: 1.35;
    color: #64748b;
    text-decoration: none;
    min-height: 2.3em;
    margin-bottom: 0.5rem;
}
.showcase-card-name:hover { color: var(--color-primary, #007791); }
.showcase-card-stars {
    display: flex;
    align-items: center;
    color: #f5a623;
    font-size: 0.85rem;
    gap: .2rem;
    margin-bottom: 0.65rem;
}
.showcase-card-stars i.is-empty { color: #dbe0e5; }
.showcase-card-stars-count {
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 600;
    margin-left: 0.35rem;
    letter-spacing: 0;
}
.showcase-card-divider {
    border: none;
    border-top: 1px solid #eef0f3;
    margin: 0 0 0.85rem;
}

.showcase-card-foot {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: auto;
}
.showcase-card-foot--wide {
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
}
.showcase-card-prices { display: flex; flex-direction: column; min-width: 0; }
.showcase-price-old {
    font-size: 0.8rem;
    color: #94a3b8;
    text-decoration: line-through;
    line-height: 1.2;
}
.showcase-price-now {
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1.25;
}
.showcase-price-inst {
    font-size: 0.78rem;
    color: #64748b;
    line-height: 1.3;
    margin-top: 0.15rem;
}
.showcase-buy {
    flex: 0 0 auto;
    width: 58px;
    height: 58px;
    border: none;
    border-radius: 16px;
    font-size: 1.3rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: filter .15s ease, transform .15s ease;
}
.showcase-buy:hover { filter: brightness(.92); transform: translateY(-1px); }
.showcase-buy-wide {
    width: 100%;
    border: none;
    border-radius: 999px;
    padding: 0.6rem;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    transition: filter .15s ease;
}
.showcase-buy-wide:hover { filter: brightness(.92); }

.showcase-card-desc {
    font-size: 0.78rem;
    color: #64748b;
    line-height: 1.4;
    margin: 0.7rem 0 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Banner vertical como primeiro card (modelo banner_side) */
.showcase-sidebanner {
    padding: 0;
    overflow: hidden;
    position: relative;
    justify-content: flex-end;
    min-height: 340px;
    text-decoration: none;
}
.showcase-sidebanner img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.showcase-sidebanner-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
}
.showcase-sidebanner-body {
    position: relative;
    z-index: 2;
    padding: 1.1rem;
    width: 100%;
}
.showcase-sidebanner-body h3 {
    font-size: 1rem;
    font-weight: 800;
    margin: 0 0 0.6rem;
    text-shadow: 0 1px 4px rgba(0,0,0,.35);
}
.showcase-sidebanner-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.45rem 0.9rem;
    border-radius: 9999px;
}

/* Cronômetro do banner de promoção (lateral ou superior) */
.showcase-countdown {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.9rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    background: rgba(0, 0, 0, 0.35);
    padding: 0.35rem 0.7rem;
    border-radius: 8px;
    margin: 0.4rem 0;
    letter-spacing: 0.02em;
}

/* Navegação: setas + bolinhas centralizadas embaixo */
.showcase-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.9rem;
    margin-top: 1.1rem;
}
.showcase-nav-arrow {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid #cbd5e1;
    background: #fff;
    color: #475569;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .15s ease;
}
.showcase-nav-arrow:hover:not(:disabled) {
    border-color: var(--color-primary, #007791);
    color: var(--color-primary, #007791);
}
.showcase-nav-arrow:disabled {
    opacity: .4;
    cursor: default;
}
.showcase-dots {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.showcase-dot {
    width: 8px;
    height: 8px;
    border: none;
    border-radius: 9999px;
    background: #cbd5e1;
    padding: 0;
    cursor: pointer;
    transition: all .2s ease;
}
.showcase-dot.active {
    width: 22px;
    background: var(--color-primary, #007791);
}

/* Responsivo: tablet 3–4 cols, mobile 2 colunas */
@media (max-width: 1200px) {
    .showcase-carousel-row .showcase-card { flex-basis: calc((100% - 3rem) / 4); }
}
@media (max-width: 992px) {
    .showcase-carousel-row .showcase-card { flex-basis: calc((100% - 2rem) / 3); }
}
@media (max-width: 768px) {
    .showcase-section { padding: 1.5rem 0; }
    .showcase-title { font-size: 1.2rem; }
    .showcase-carousel-row { scroll-snap-type: x mandatory; }
    .showcase-carousel-row .showcase-card { flex-basis: calc((100% - 1rem) / 2); }
    .showcase-card-img { height: 130px; }
    .showcase-price-now { font-size: 1.15rem; }
    .showcase-buy { width: 46px; height: 46px; border-radius: 12px; font-size: 1.05rem; }
    .showcase-sidebanner { min-height: 100%; }
}

/* Carrosséis da ficha do produto (relacionados / similares).
   Ficam depois do último .pdp-block, que já traz a própria margem inferior;
   por isso o bloco só reduz o espaço no topo e separa um do outro com um
   filete, para não somar padding em cima de padding. */
.pdp-carousel-block {
    padding-top: 0.5rem;
}
.pdp-carousel-block + .pdp-carousel-block {
    border-top: 1px solid var(--s-color-border, #e2e8f0);
}
.pdp-carousel-block:last-of-type {
    padding-bottom: 2.5rem;
}
