:root {
    --ink: #111827;
    --muted: #6b7280;
    --line: #e5e7eb;
    --soft: #f6f7f9;
    --brand: #2563eb;
    --brand-dark: #1d4ed8;
    --ok: #16a34a;
    --card: #ffffff;
}

* {
    box-sizing: border-box;
    letter-spacing: 0;
}

html {
    width: 100%;
    overflow-x: hidden;
}

body {
    font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    background: var(--soft);
    color: var(--ink);
    width: 100%;
    min-width: 0;
    overflow-x: hidden;
}

img,
video,
canvas,
svg {
    max-width: 100%;
}

.container {
    max-width: min(1120px, 100%);
}

.catalog-header {
    background: rgba(255,255,255,.96);
    border-bottom: 1px solid rgba(17,24,39,.08);
    backdrop-filter: blur(10px);
    padding: 10px 0;
}

.brand-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--ink);
    text-decoration: none;
    min-width: 0;
}

.brand-mark {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    color: #fff;
    background: linear-gradient(135deg, var(--ink), #334155);
}

.brand-logo {
    width: 44px;
    height: 44px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: #fff;
}

.brand-link strong {
    display: block;
    line-height: 1.1;
    font-size: .98rem;
    max-width: min(58vw, 360px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.brand-link small {
    display: block;
    color: var(--muted);
    font-size: .75rem;
}

.cart-link {
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    position: relative;
    color: var(--ink);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    text-decoration: none;
    box-shadow: 0 8px 24px rgba(17,24,39,.08);
}

.cart-link i { font-size: 1.25rem; }

.cart-badge {
    position: absolute;
    top: -7px;
    right: -7px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    display: grid;
    place-items: center;
    color: #fff;
    background: #ef4444;
    border: 2px solid #fff;
    border-radius: 999px;
    font-size: .7rem;
    font-weight: 800;
}

.catalog-footer {
    color: var(--muted);
    font-size: .85rem;
    padding: 36px 16px 40px;
    border-top: 1px solid rgba(0,0,0,.06);
    margin-top: 28px;
    background: #fff;
}
.catalog-footer-inner {
    max-width: 980px;
    margin: 0 auto 14px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    flex-wrap: wrap;
}
.catalog-footer-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}
.catalog-footer-brand strong {
    display: block;
    color: #111;
    font-size: .95rem;
    margin-bottom: 2px;
}
.catalog-footer-brand span {
    font-size: .78rem;
    color: var(--muted);
}
.catalog-footer-logo {
    width: 44px; height: 44px;
    border-radius: 10px;
    object-fit: cover;
    border: 1px solid rgba(0,0,0,.06);
    flex-shrink: 0;
}
.catalog-footer-contact {
    text-align: right;
    font-size: .82rem;
    line-height: 1.55;
    color: var(--muted);
}
.catalog-footer-contact div { margin-bottom: 2px; }
.catalog-footer-contact i { color: var(--brand); margin-right: 4px; }
.catalog-footer-contact a {
    color: inherit;
    text-decoration: none;
}
.catalog-footer-contact a:hover { color: var(--brand); }
.catalog-footer small {
    display: block;
    text-align: center;
    margin-top: 14px;
    color: var(--muted);
}

@media (max-width: 640px) {
    .catalog-footer-inner { flex-direction: column; gap: 14px; }
    .catalog-footer-contact { text-align: left; }
}

.page-heading { margin-bottom: 16px; }
.page-heading .eyebrow {
    display: block;
    color: var(--brand);
    font-size: .75rem;
    font-weight: 800;
    text-transform: uppercase;
}
.page-heading h1 {
    margin: 0;
    font-size: 1.55rem;
    font-weight: 800;
}

.catalog-intro {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 16px;
    margin: 6px 0 18px;
    padding: 16px;
    background: linear-gradient(180deg, #fff, #fbfdff);
    border: 1px solid rgba(17,24,39,.08);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(17,24,39,.06);
    min-width: 0;
}

.catalog-intro h1 {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 900;
    overflow-wrap: anywhere;
}

.catalog-intro p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: .92rem;
}

.eyebrow {
    color: var(--brand);
    font-size: .72rem;
    font-weight: 850;
    text-transform: uppercase;
}

.intro-count {
    flex: 0 0 auto;
    min-width: 78px;
    padding: 10px;
    text-align: center;
    color: #fff;
    background: var(--ink);
    border-radius: 14px;
}

.intro-count strong {
    display: block;
    font-size: 1.25rem;
    line-height: 1;
}

.intro-count span {
    display: block;
    margin-top: 3px;
    font-size: .72rem;
    color: rgba(255,255,255,.72);
}

.catalogo-header { max-width: 680px; margin: 0 auto 18px; }

.search-input-wrapper {
    position: relative;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(17,24,39,.06);
}

.search-input-wrapper i.bi-search {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    font-size: 1.05rem;
}

.search-input-wrapper .form-control {
    border: none;
    padding: .85rem 1rem .85rem 3rem;
    border-radius: 14px;
    background: transparent;
    font-size: 1rem;
}

.search-input-wrapper .form-control:focus { box-shadow: none; }

.clear-search {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
}

.categorias-scroll {
    margin-left: -12px;
    margin-right: -12px;
    padding: 8px 12px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    position: sticky;
    top: 62px;
    z-index: 10;
    background: rgba(246,247,249,.94);
    backdrop-filter: blur(10px);
}

.categorias-scroll::-webkit-scrollbar { display: none; }

.categorias-row {
    display: flex;
    gap: 8px;
    width: max-content;
    min-width: 100%;
}

.cat-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--ink);
    background: #fff;
    text-decoration: none;
    padding: 9px 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: .86rem;
    font-weight: 700;
    white-space: nowrap;
    box-shadow: 0 5px 14px rgba(17,24,39,.04);
}

.cat-chip:hover {
    color: var(--brand);
    border-color: rgba(37,99,235,.35);
}

.cat-count {
    color: var(--brand);
    background: rgba(37,99,235,.10);
    border-radius: 999px;
    padding: 1px 7px;
    font-size: .72rem;
}

.categoria-section {
    margin-bottom: 34px;
    scroll-margin-top: 92px;
}

.categoria-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 13px;
    gap: 10px;
}

.categoria-titulo {
    font-size: 1.05rem;
    font-weight: 850;
    margin: 0;
    min-width: 0;
    overflow-wrap: anywhere;
}

.categoria-count {
    color: var(--muted);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 4px 10px;
    font-size: .75rem;
    font-weight: 700;
}

.produtos-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

@media (max-width: 359px) {
    .produtos-grid {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 576px) { .produtos-grid { grid-template-columns: repeat(3, 1fr); gap: 15px; } }
@media (min-width: 768px) { .produtos-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1200px) { .produtos-grid { grid-template-columns: repeat(5, 1fr); } }

.produto-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    color: inherit;
    background: var(--card);
    border: 1px solid rgba(17,24,39,.07);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 6px 18px rgba(17,24,39,.055);
    transition: transform .18s ease, box-shadow .18s ease;
}

.produto-card-main,
.produto-title-link {
    color: inherit;
    text-decoration: none;
}

.produto-card:hover {
    color: inherit;
    transform: translateY(-2px);
    box-shadow: 0 16px 34px rgba(17,24,39,.10);
}

.produto-card-image {
    position: relative;
    aspect-ratio: 1/1.08;
    overflow: hidden;
    background: #eef1f4;
}

.produto-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .25s ease;
}

.produto-card:hover .produto-card-image img { transform: scale(1.035); }

.produto-card-image .no-image {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    color: #cbd5e1;
    font-size: 2.25rem;
}

.produto-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    color: #111827;
    background: #facc15;
    border-radius: 999px;
    padding: 4px 9px;
    font-size: .68rem;
    font-weight: 850;
}

.produto-badge.badge-danger {
    color: #fff;
    background: #dc2626;
}

.produto-card-body { padding: 9px 10px 11px; }

.produto-nome {
    min-height: 2.25em;
    margin-bottom: 8px;
    color: var(--ink);
    font-size: .84rem;
    font-weight: 800;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    overflow-wrap: anywhere;
}

.produto-precos {
    border-top: 1px solid #f1f5f9;
    padding-top: 9px;
}

.preco-pacote {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.preco-unitario {
    display: block;
    color: var(--muted);
    font-size: .74rem;
    font-weight: 750;
    margin-bottom: 3px;
}

.preco-label {
    color: var(--muted);
    font-size: .72rem;
    font-weight: 750;
    text-transform: uppercase;
}

.preco-valor {
    color: var(--brand);
    font-size: 1.12rem;
    font-weight: 900;
}

.produto-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    margin-top: 8px;
    color: #fff;
    background: var(--brand);
    border-radius: 8px;
    padding: 7px 8px;
    font-size: .76rem;
    font-weight: 800;
    text-decoration: none;
}

.produto-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.quick-add-btn {
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    margin-top: 8px;
    color: #fff;
    background: var(--ok);
    border: none;
    border-radius: 10px;
    font-weight: 900;
    box-shadow: 0 8px 18px rgba(22,163,74,.22);
    transition: transform .15s ease, background .15s ease;
}

.quick-add-btn:hover {
    transform: translateY(-1px);
}

.quick-add-btn.added {
    background: var(--brand);
}

.quick-add-btn:disabled {
    cursor: not-allowed;
    background: #9ca3af;
    box-shadow: none;
    opacity: .75;
}

.main-image-wrapper {
    position: relative;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    overflow: hidden;
    aspect-ratio: 1/1;
    box-shadow: 0 12px 30px rgba(17,24,39,.08);
}

.main-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #fff;
    user-select: none;
}

.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    color: var(--ink);
    background: rgba(255,255,255,.94);
    border: 1px solid rgba(17,24,39,.08);
    border-radius: 999px;
    box-shadow: 0 8px 18px rgba(17,24,39,.15);
}

.gallery-nav.prev { left: 12px; }
.gallery-nav.next { right: 12px; }

.image-counter {
    position: absolute;
    right: 12px;
    bottom: 12px;
    color: #fff;
    background: rgba(17,24,39,.74);
    border-radius: 999px;
    padding: 4px 11px;
    font-size: .78rem;
    font-weight: 700;
}

.thumbnails-row {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 4px 0;
}

.thumb-item {
    flex: 0 0 68px;
    aspect-ratio: 1/1;
    padding: 0;
    background: #fff;
    border: 2px solid transparent;
    border-radius: 10px;
    overflow: hidden;
}

.thumb-item img { width: 100%; height: 100%; object-fit: cover; }
.thumb-item.active { border-color: var(--brand); }

.product-info { padding: 0 2px; }

.product-code {
    display: inline-flex;
    color: var(--muted);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 4px 10px;
    font-size: .75rem;
    font-weight: 800;
    margin-bottom: 10px;
}

.product-title {
    color: var(--ink);
    font-size: 1.55rem;
    font-weight: 900;
    line-height: 1.15;
}

.price-block,
.purchase-box,
.checkout-form,
.checkout-summary,
.total-card,
.cart-item {
    background: #fff;
    border: 1px solid rgba(17,24,39,.08);
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(17,24,39,.06);
}

.price-block { padding: 16px; }

.unit-price-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    color: var(--muted);
    border-bottom: 1px solid var(--line);
    padding-bottom: 10px;
    margin-bottom: 12px;
    font-size: .9rem;
}

.unit-price-info strong {
    color: var(--ink);
    white-space: nowrap;
}

.price-package {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.price-label { color: var(--muted); font-size: .9rem; font-weight: 750; }
.price-value { color: var(--brand); font-size: 1.65rem; font-weight: 950; white-space: nowrap; }

.purchase-box { padding: 16px; }

.package-summary {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 12px;
    align-items: center;
}

.qty-controls {
    display: flex;
    align-items: stretch;
    max-width: 180px;
}

.qty-controls input {
    border-left: none;
    border-right: none;
    font-weight: 800;
    -moz-appearance: textfield;
}

.qty-controls input::-webkit-outer-spin-button,
.qty-controls input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.total-preview {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0 0;
    border-top: 1px dashed var(--line);
    font-size: 1.05rem;
}

.btn-success {
    background: var(--ok);
    border-color: var(--ok);
    font-weight: 800;
    box-shadow: 0 12px 24px rgba(22,163,74,.22);
}

.btn-primary {
    background: var(--brand);
    border-color: var(--brand);
    font-weight: 800;
}

.empty-state {
    text-align: center;
    color: var(--muted);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 44px 18px;
}

.empty-state i {
    color: #cbd5e1;
    font-size: 4rem;
}

.empty-state h5 {
    margin-top: 14px;
    color: var(--ink);
    font-weight: 850;
}

.cart-item { padding: 12px; margin-bottom: 10px; }
.cart-thumb {
    width: 66px;
    height: 66px;
    object-fit: cover;
    border-radius: 10px;
}

.total-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
}

.total-card span { color: var(--muted); font-weight: 750; }
.total-card strong { color: var(--brand); font-size: 1.35rem; }

.checkout-form { padding: 16px; }

.checkout-summary { padding: 14px; }
.checkout-summary h6 {
    color: var(--ink);
    font-weight: 850;
    margin-bottom: 10px;
}

.summary-line,
.summary-total {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
}

.summary-line span,
.cart-item .fw-bold {
    min-width: 0;
    overflow-wrap: anywhere;
}

.summary-line span {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.summary-line small { color: var(--muted); margin-top: 2px; }

.summary-total {
    border-top: 1px dashed var(--line);
    margin-top: 8px;
    padding-top: 12px;
    font-size: 1.08rem;
}

.summary-total strong { color: var(--brand); }

@media (min-width: 768px) {
    main.container { max-width: 1120px; }
    .product-title { font-size: 1.9rem; }
}

@media (max-width: 575.98px) {
    .catalog-header {
        padding: 8px 0;
    }

    main.container {
        padding-left: 12px;
        padding-right: 12px;
    }

    .brand-mark,
    .brand-logo {
        width: 38px;
        height: 38px;
        border-radius: 10px;
    }

    .brand-link {
        gap: 8px;
    }

    .brand-link strong {
        font-size: .92rem;
        max-width: 54vw;
    }

    .brand-link small {
        font-size: .69rem;
    }

    .cart-link {
        width: 39px;
        height: 39px;
    }

    .catalog-intro {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 14px;
    }

    .catalog-intro h1 {
        font-size: 1.22rem;
    }

    .catalog-intro p {
        font-size: .86rem;
    }

    .intro-count {
        width: 100%;
        display: flex;
        justify-content: center;
        align-items: baseline;
        gap: 6px;
        padding: 9px;
    }

    .intro-count strong,
    .intro-count span {
        display: inline;
        margin: 0;
    }

    .categorias-scroll {
        top: 56px;
        margin-left: -12px;
        margin-right: -12px;
    }

    .categoria-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .categoria-count {
        align-self: flex-start;
    }

    .produto-card-image {
        aspect-ratio: 1/1.03;
    }

    .produto-card-body {
        padding: 8px 8px 10px;
    }

    .produto-nome {
        font-size: .82rem;
    }

    .preco-valor {
        font-size: 1.02rem;
    }

    .produto-cta {
        padding: 7px 6px;
    }

    .quick-add-btn {
        flex-basis: 36px;
        width: 36px;
        height: 36px;
    }

    .product-title {
        font-size: 1.34rem;
    }

    .price-package,
    .package-summary,
    .total-preview,
    .summary-line,
    .summary-total {
        align-items: flex-start;
        flex-direction: column;
    }

    .price-value {
        font-size: 1.45rem;
        white-space: normal;
    }

    .qty-controls {
        width: 100%;
        max-width: none;
    }

    .cart-item {
        padding: 10px;
    }

    .cart-thumb {
        width: 58px;
        height: 58px;
    }

    .total-card {
        gap: 8px;
    }

    .checkout-form .btn,
    .purchase-box .btn,
    #cart-content > .btn {
        min-height: 48px;
    }
}

@media (max-width: 420px) {
    main.container {
        padding-left: 10px;
        padding-right: 10px;
    }

    .produtos-grid {
        gap: 8px;
    }

    .preco-label {
        font-size: .68rem;
    }

    .preco-unitario {
        font-size: .69rem;
    }

    .preco-valor {
        font-size: .98rem;
    }

    .produto-cta {
        font-size: .72rem;
    }
}

@media (max-width: 319px) {
    .brand-link small,
    .intro-count {
        display: none;
    }

    .brand-link strong {
        max-width: 48vw;
    }
}

@media (min-width: 576px) and (max-width: 767.98px) {
    .product-detail {
        align-items: start;
    }
}

@media (min-width: 1400px) {
    main.container {
        max-width: 1240px;
    }

    .produtos-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

@media (hover: none) {
    .produto-card:hover {
        transform: none;
    }
}
