/* Magic Catálogo — tema escuro, camada sobre Bootstrap 5 */

:root {
    --cat-bg-deep: #0b0d12;
    --cat-surface: #12151c;
    --cat-surface-2: #1a1f2a;
    --cat-accent: #7c3aed;
    --cat-accent-hover: #8b5cf6;
    /* Verde “mana” / ação de carrinho, legível no tema escuro */
    --cat-cart-green: #1db87a;
    --cat-cart-green-hover: #2dd48f;
    --cat-cart-green-border: #148f5e;
    --cat-radius-card: 1rem;
    --cat-shadow-card: 0 12px 40px rgba(0, 0, 0, 0.35);
    --cat-transition: 0.22s ease;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: radial-gradient(1200px 600px at 10% -10%, rgba(124, 58, 237, 0.12), transparent 55%),
        radial-gradient(900px 500px at 100% 0%, rgba(59, 130, 246, 0.08), transparent 50%),
        var(--cat-bg-deep);
    color: #e8eaef;
}

.site-main {
    flex: 1 0 auto;
}

.skip-link:focus {
    z-index: 1080;
}

.site-header .navbar {
    background: rgba(18, 21, 28, 0.92) !important;
    backdrop-filter: blur(10px);
}

.brand-mark {
    width: 2.25rem;
    height: 2.25rem;
    font-size: 1.1rem;
    background: linear-gradient(135deg, var(--cat-accent), #2563eb);
    color: #fff;
    box-shadow: 0 4px 14px rgba(124, 58, 237, 0.35);
}

.navbar .nav-link {
    border-radius: 0.5rem;
}

.navbar .nav-link.active {
    color: #fff !important;
    background: rgba(124, 58, 237, 0.2);
}

.nav-cart {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

/* Header: ícone da sacola + badge sempre visíveis (antes ficavam atrás do menu hambúrguer no mobile) */
.nav-cart.nav-cart--header {
    flex-shrink: 0;
    min-width: 2.75rem;
    min-height: 2.75rem;
    justify-content: center;
    border-radius: 0.5rem;
}

.nav-cart.nav-cart--header .nav-cart__icon svg {
    width: 24px;
    height: 24px;
}

@media (min-width: 992px) {
    .nav-cart.nav-cart--header {
        min-width: 0;
        min-height: 0;
        justify-content: flex-start;
    }

    .nav-cart.nav-cart--header .nav-cart__icon svg {
        width: 22px;
        height: 22px;
    }
}

.nav-cart__icon {
    display: inline-flex;
    line-height: 0;
}

.nav-cart__badge {
    position: absolute;
    top: 0.1rem;
    right: 0.15rem;
    min-width: 1.1rem;
    padding: 0.2em 0.45em;
    font-size: 0.65rem;
    font-weight: 700;
    transform: translate(35%, -35%);
}

@media (min-width: 992px) {
    .nav-cart__badge {
        right: 0.35rem;
    }
}

/* Botão na grade: acima do ::after do .stretched-link (Bootstrap usa z-index: 1) */
.product-card__cart-row {
    margin-top: auto;
    position: relative;
    z-index: 3;
    padding-bottom: 1.25rem !important;
    flex-wrap: nowrap;
}

.product-card__cart-row .btn-add-to-cart,
.product-card__cart-row .product-card__btn-details {
    position: relative;
    z-index: 1;
}

.product-card__btn-details {
    flex: 1 1 auto;
    max-width: 65%;
    min-width: 0;
    font-weight: 600;
    letter-spacing: 0.02em;
    justify-content: flex-start;
}

.product-card__btn-cart {
    flex: 0 0 auto;
    width: 30%;
    max-width: 30%;
    min-width: 0;
    margin-left: auto;
    padding-inline: 0.35rem;
    font-weight: 700;
    line-height: 1;
    color: #fff;
    background: var(--cat-cart-green);
    border: 1px solid var(--cat-cart-green-border);
    transition: background var(--cat-transition), border-color var(--cat-transition), transform var(--cat-transition), box-shadow var(--cat-transition);
}

.product-card__btn-cart:hover {
    color: #fff;
    background: var(--cat-cart-green-hover);
    border-color: var(--cat-cart-green);
}

.product-card__btn-cart:focus-visible {
    color: #fff;
    outline: 2px solid rgba(45, 212, 143, 0.65);
    outline-offset: 2px;
}

.product-card__btn-cart-icon {
    flex-shrink: 0;
    display: block;
}

.product-card__btn-cart.btn-success,
.product-card__btn-cart.btn-success:hover {
    color: #fff;
    background: #15803d;
    border-color: #166534;
}

/* Sacola */
.sacola-thumb {
    width: 56px;
    height: 56px;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--cat-surface-2);
}

.sacola-thumb--empty {
    border: 1px dashed rgba(255, 255, 255, 0.12);
}

.sacola-table thead th {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(255, 255, 255, 0.45);
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

.sacola-table td {
    vertical-align: middle;
    border-color: rgba(255, 255, 255, 0.06);
}

.sacola-item-name {
    font-size: 0.95rem;
    line-height: 1.3;
}

.sacola-qty .btn {
    min-width: 2.25rem;
}

.sacola-qty-val {
    min-width: 2.5rem;
    pointer-events: none;
}

.sacola-summary {
    position: sticky;
    top: 5.5rem;
}

.sacola-empty {
    max-width: 520px;
    margin-inline: auto;
}

/* Listagem */
.catalog-hero {
    padding-block: 2.5rem 1.5rem;
}

.catalog-hero h1 {
    letter-spacing: -0.02em;
}

.product-card {
    position: relative;
    background: var(--cat-surface);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--cat-radius-card);
    overflow: hidden;
    box-shadow: var(--cat-shadow-card);
    transition: transform var(--cat-transition), border-color var(--cat-transition), box-shadow var(--cat-transition);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.product-card:hover,
.product-card:focus-within {
    transform: translateY(-4px);
    border-color: rgba(124, 58, 237, 0.35);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(124, 58, 237, 0.15);
}

.product-card__link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    flex: 1;
    outline: none;
}

.product-card__media {
    aspect-ratio: 1 / 1;
    background: var(--cat-surface-2);
    position: relative;
    overflow: hidden;
}

.product-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--cat-transition);
}

.product-card:hover .product-card__media img,
.product-card:focus-within .product-card__media img {
    transform: scale(1.04);
}

.product-card__body {
    padding: 1.1rem 1.15rem 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-card:has(.product-card__source) .product-card__body {
    padding-bottom: 1.85rem;
}

.product-card__title {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.35;
    margin: 0;
    color: #f1f3f8;
}

.product-card__price {
    margin-top: 0.45rem;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: #c4b5fd;
}

.product-card__price--muted {
    font-size: 0.82rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.42);
}

/* Link à fonte: acima do ::after do stretched-link (z-index 1 no Bootstrap) */
.product-card__source {
    position: absolute;
    right: 0.45rem;
    bottom: 0.4rem;
    z-index: 2;
    font-size: 0.65rem;
    line-height: 1.2;
    letter-spacing: 0.02em;
    color: rgba(255, 255, 255, 0.38);
    text-decoration: none;
    padding: 0.2rem 0.35rem;
    border-radius: 0.25rem;
    max-width: 42%;
    text-align: right;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-card__source:hover,
.product-card__source:focus-visible {
    color: rgba(255, 255, 255, 0.72);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.product-card__source:focus-visible {
    outline: 1px solid rgba(124, 58, 237, 0.6);
    outline-offset: 1px;
}

/* Página produto */
.breadcrumb-wrap {
    font-size: 0.875rem;
}

.breadcrumb-item + .breadcrumb-item::before {
    color: rgba(255, 255, 255, 0.35);
}

.product-layout {
    padding-block: 2rem 3rem;
}

.product-gallery {
    background: var(--cat-surface);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--cat-radius-card);
    overflow: hidden;
    box-shadow: var(--cat-shadow-card);
}

.product-gallery .carousel-item {
    aspect-ratio: 1 / 1;
    background: var(--cat-surface-2);
}

.product-gallery .carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 0.75rem;
}

/* Controles do carrossel: disco branco ~60% transparente para destacar as setas */
.product-gallery .carousel-control-prev,
.product-gallery .carousel-control-next {
    --product-carousel-control-bg: rgba(255, 255, 255, 0.4);
    --product-carousel-control-bg-hover: rgba(255, 255, 255, 0.55);

    top: 50%;
    bottom: auto;
    width: 3rem;
    height: 3rem;
    margin-top: 0;
    margin-bottom: 0;
    transform: translateY(-50%);
    border-radius: 50%;
    border: 0;
    opacity: 1;
    background-color: var(--product-carousel-control-bg);
    background-image: none;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
    transition: background-color var(--cat-transition), box-shadow var(--cat-transition);
}

.product-gallery .carousel-control-prev {
    left: 0.65rem;
}

.product-gallery .carousel-control-next {
    right: 0.65rem;
}

.product-gallery .carousel-control-prev:hover,
.product-gallery .carousel-control-next:hover,
.product-gallery .carousel-control-prev:focus,
.product-gallery .carousel-control-next:focus {
    opacity: 1;
    background-color: var(--product-carousel-control-bg-hover);
}

.product-gallery .carousel-control-prev:focus-visible,
.product-gallery .carousel-control-next:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.85);
    outline-offset: 2px;
}

.product-gallery .carousel-indicators [data-bs-target] {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.45);
}

.product-gallery .carousel-indicators .active {
    background-color: var(--cat-accent);
}

.product-detail-card {
    background: var(--cat-surface);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--cat-radius-card);
    padding: 1.5rem 1.5rem 1.75rem;
    box-shadow: var(--cat-shadow-card);
}

@media (min-width: 992px) {
    .product-detail-card {
        padding: 2rem 2rem 2.25rem;
    }
}

.product-detail-card h1 {
    font-size: clamp(1.35rem, 2.5vw, 1.85rem);
    letter-spacing: -0.02em;
    line-height: 1.25;
}

.price-slot {
    margin-top: 1.25rem;
    padding: 1rem 1.1rem;
    border-radius: 0.75rem;
    background: rgba(0, 0, 0, 0.25);
    border: 1px dashed rgba(255, 255, 255, 0.12);
}

.price-slot__label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.45);
    margin-bottom: 0.25rem;
}

.price-slot__value {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: #c4b5fd;
}

.price-slot__value .price-slot__muted {
    font-size: 0.82rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.42);
}

.description-block {
    margin-top: 1.5rem;
    color: rgba(232, 234, 239, 0.82);
    font-size: 0.95rem;
    line-height: 1.65;
}

.description-block p:last-child {
    margin-bottom: 0;
}

.link-descricao-mais {
    margin-left: 0.15rem;
    font-weight: 600;
    color: var(--cat-accent);
}

.link-descricao-mais:hover,
.link-descricao-mais:focus-visible {
    color: var(--cat-accent-hover);
    text-decoration: underline !important;
    text-underline-offset: 2px;
}

#descricao-produto {
    scroll-margin-top: 6.5rem;
}

.product-description-full {
    background: var(--cat-surface);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--cat-radius-card);
    padding: 1.25rem 1.35rem 1.5rem;
    box-shadow: var(--cat-shadow-card);
}

@media (min-width: 992px) {
    .product-description-full {
        padding: 1.5rem 1.65rem 1.75rem;
    }
}

.product-description-full__body {
    color: rgba(232, 234, 239, 0.88);
    font-size: 0.95rem;
    line-height: 1.65;
}

.product-description-full__body :last-child {
    margin-bottom: 0;
}

.product-description-full__body a {
    color: var(--cat-accent);
}

.product-description-full__body a:hover,
.product-description-full__body a:focus-visible {
    color: var(--cat-accent-hover);
}

.btn-add-cart {
    margin-top: 1.75rem;
    padding-block: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    border: none;
    background: linear-gradient(135deg, var(--cat-accent), #4f46e5);
    color: #fff;
    box-shadow: 0 8px 24px rgba(124, 58, 237, 0.35);
    transition: transform var(--cat-transition), box-shadow var(--cat-transition), filter var(--cat-transition);
}

.btn-add-cart:hover {
    color: #fff;
    filter: brightness(1.06);
    transform: translateY(-1px);
    box-shadow: 0 12px 28px rgba(124, 58, 237, 0.45);
}

.btn-add-cart:focus-visible {
    outline: 2px solid var(--cat-accent-hover);
    outline-offset: 3px;
}

.alert-soft {
    background: rgba(220, 53, 69, 0.12);
    border: 1px solid rgba(220, 53, 69, 0.35);
    color: #f8b4bd;
}

.img-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: rgba(255, 255, 255, 0.35);
    font-size: 0.9rem;
    text-align: center;
    padding: 1rem;
}
