/**
 * 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: #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;
}
.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-desktop { display: none; }
    .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;
    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; }

/* 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: 14px;
    padding: 1rem;
    position: relative;
    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-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    min-height: 26px;
}
.showcase-badge {
    font-size: 0.72rem;
    font-weight: 800;
    padding: 0.18rem 0.5rem;
    border-radius: 6px;
    line-height: 1.3;
}
.showcase-fav {
    width: 30px;
    height: 30px;
    border: none;
    background: transparent;
    color: #94a3b8;
    font-size: 1rem;
    cursor: pointer;
    border-radius: 50%;
    transition: color .15s ease, background .15s ease;
    margin-left: auto;
}
.showcase-fav:hover { background: #f1f5f9; }
.showcase-fav.is-active { color: #e11d48; }

.showcase-card-img {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 170px;
    margin: 0.35rem 0 0.75rem;
    overflow: hidden;
}
.showcase-card-img img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
    transition: transform .25s ease;
}
.showcase-card:hover .showcase-card-img img { transform: scale(1.05); }

.showcase-promo-tag {
    align-self: flex-start;
    font-size: 0.66rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .02em;
    padding: 0.22rem 0.5rem;
    border-radius: 5px;
    margin-bottom: 0.55rem;
    line-height: 1.25;
}
.showcase-card-brand {
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    color: #334155;
    letter-spacing: .02em;
    margin-bottom: 0.2rem;
}
.showcase-card-name {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 0.86rem;
    line-height: 1.35;
    color: #475569;
    text-decoration: none;
    min-height: 2.3em;
    margin-bottom: 0.4rem;
}
.showcase-card-name:hover { color: #007791; }
.showcase-card-stars {
    color: #f5a623;
    font-size: 0.78rem;
    letter-spacing: .05em;
    margin-bottom: 0.55rem;
}

.showcase-card-foot {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: auto;
}
.showcase-card-prices { display: flex; flex-direction: column; min-width: 0; }
.showcase-price-old {
    font-size: 0.78rem;
    color: #94a3b8;
    text-decoration: line-through;
    line-height: 1.2;
}
.showcase-price-now {
    font-size: 1.15rem;
    font-weight: 800;
    line-height: 1.2;
}
.showcase-price-inst {
    font-size: 0.74rem;
    color: #64748b;
    line-height: 1.3;
    margin-top: 0.1rem;
}
.showcase-buy {
    flex: 0 0 auto;
    width: 46px;
    height: 46px;
    border: none;
    border-radius: 10px;
    font-size: 1.05rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: filter .15s ease;
}
.showcase-buy: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;
}

/* 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: #007791;
    color: #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: #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.05rem; }
    .showcase-buy { width: 40px; height: 40px; font-size: 0.95rem; }
    .showcase-sidebanner { min-height: 100%; }
}
