:root {
    /* Theme Light (Padrão) */
    --nw-card-bg: #ffffff;
    --nw-border: #e2e8f0;
    --nw-accent: #79e9d4;
    --nw-accent-dark: #090d12;
    --nw-text-main: #0f172a;
    --nw-text-muted: #64748b;
    --nw-img-bg: #f8fafc;
    --nw-danger: #ef4444;
    --nw-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    --nw-shadow-hover: 0 8px 24px rgba(121, 233, 212, 0.25);
}

/* Theme Dark */
body.dark, body.dark-mode, body.dark-theme, [data-theme="dark"], html.dark {
    --nw-card-bg: #151c28;
    --nw-border: #263347;
    --nw-text-main: #f1f5f9;
    --nw-text-muted: #94a3b8;
    --nw-img-bg: #0b0f17;
    --nw-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    --nw-shadow-hover: 0 8px 20px rgba(121, 233, 212, 0.15);
}

.nw-card {
    position: relative;
    background-color: var(--nw-card-bg);
    border: 1px solid var(--nw-border);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 1rem;
    contain: content;
    box-shadow: var(--nw-shadow);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.nw-card:hover {
    border-color: var(--nw-accent);
    transform: translateY(-3px);
    box-shadow: var(--nw-shadow-hover);
}

.nw-card-clickable, 
.nw-card-clickable:hover, 
.nw-card-clickable:focus {
    cursor: pointer;
    text-decoration: none !important;
    color: inherit;
    display: block;
    outline: none;
}

/* Badges */
.nw-badge {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 0.25rem 0.55rem;
    border-radius: 6px;
    letter-spacing: 0.04em;
    z-index: 2;
    text-transform: uppercase;
}

.nw-badge-pre-venda {
    background-color: var(--nw-accent);
    color: var(--nw-accent-dark);
    box-shadow: 0 2px 6px rgba(121, 233, 212, 0.3);
}

.nw-badge-brevemente {
    background-color: var(--nw-text-main);
    color: var(--nw-card-bg);
}

/* Container de Imagem Anti-CLS */
.nw-img-wrapper {
    width: 100%;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    background-color: var(--nw-img-bg);
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nw-card-img {
    width: 100%;
    height: 100%;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    display: block;
    padding: 0.5rem;
    transition: transform 0.3s ease;
}

.nw-card:hover .nw-card-img {
    transform: scale(1.03);
}

.nw-out-of-stock .nw-card-img {
    filter: grayscale(100%);
    opacity: 0.55;
}

/* Tipografia */
.nw-card-cat {
    display: block;
    font-size: 0.68rem;
    color: var(--nw-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.85rem;
    font-weight: 600;
}

.nw-card-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--nw-text-main);
    margin: 0.3rem 0 0.85rem 0;
    line-height: 1.35;
    text-decoration: none !important;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.5em;
}

/* Rodapé Flexível */
.nw-card-footer {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: auto;
    padding-top: 0.75rem;
    border-top: 1px solid var(--nw-border);
}

.nw-price-container {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.nw-card-price {
    font-weight: 800;
    font-size: 1.05rem;
    color: var(--nw-text-main);
    line-height: 1.1;
}

.nw-price-accent { 
    color: var(--nw-text-main); 
}

body.dark .nw-price-accent,
body.dark-theme .nw-price-accent,
[data-theme="dark"] .nw-price-accent {
    color: #ffffff;
}

.nw-price-danger { 
    color: var(--nw-danger); 
    font-size: 0.85rem; 
}

.nw-price-subtext {
    font-size: 0.63rem;
    color: var(--nw-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 0.15rem;
}

.nw-subtext-accent {
    color: #0d9488;
    font-weight: 700;
}

body.dark .nw-subtext-accent,
body.dark-theme .nw-subtext-accent,
[data-theme="dark"] .nw-subtext-accent {
    color: var(--nw-accent);
}

/* Botões Quadrados Uniformes (42x42px) */
.nw-quick-add {
    width: 42px;
    height: 42px;
    min-height: 42px;
    min-width: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    flex-shrink: 0;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.nw-quick-add.btn-stock,
.nw-quick-add.btn-pre-venda {
    background-color: var(--nw-accent);
    color: var(--nw-accent-dark);
}

.nw-quick-add.btn-stock:hover,
.nw-quick-add.btn-pre-venda:hover {
    filter: brightness(0.92);
}

.nw-quick-add:active {
    transform: scale(0.95);
}

.nw-quick-add.btn-disabled {
    background-color: var(--nw-border);
    color: var(--nw-text-muted);
    cursor: not-allowed;
}