:root {
    --bg-dark: #070b12;
    --bg-card: rgba(15, 23, 42, 0.75);
    --border-color: rgba(56, 189, 248, 0.15);
    --primary-blue: #0284c7;
    --cyan-accent: #00e5ff;
    --alien-green: #00ff7f;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Plus Jakarta Sans', sans-serif;
    margin: 0;
    padding: 0;
}

header {
    padding: 20px 8%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    background: rgba(7, 11, 18, 0.85);
}

.logo-text { 
    font-family: 'Space Grotesk', sans-serif; 
    font-size: 1.5rem; 
    font-weight: 700; 
    color: #fff; 
}

.logo-text span { 
    color: var(--cyan-accent); 
}

.hero { 
    padding: 80px 20px; 
    text-align: center; 
}

.hero h1 { 
    font-size: 2.5rem; 
    margin-bottom: 10px; 
}

/* ==========================================
   GRID E CARDS DA PÁGINA INICIAL (INDEX)
   ========================================== */
.products-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); 
    gap: 20px; 
    padding: 20px 8%; 
    align-items: stretch;
}

.products-grid .card {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.products-grid .card p {
    flex-grow: 1;
    margin-bottom: 24px;
}

.products-grid .card .btn {
    margin-top: auto;
}

/* ==========================================
   ESTILO GERAL DO CARD (PÁGINAS INTERNAS & GLOBAL)
   ========================================== */
.card { 
    background: var(--bg-card); 
    border: 1px solid var(--border-color); 
    padding: 30px; 
    border-radius: 15px; 
    box-sizing: border-box; 
    width: 100%;
}

.card h3 {
    margin-top: 0;
    margin-bottom: 12px;
}

.card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Container do Vídeo Responsivo */
.card div[style*="aspect-ratio"] {
    width: 100% !important;
}

.btn { 
    display: inline-block; 
    padding: 10px 24px; 
    background: var(--cyan-accent); 
    color: #000; 
    border-radius: 5px; 
    text-decoration: none; 
    font-weight: bold; 
    transition: background 0.2s ease, transform 0.2s ease;
}

.btn:hover { 
    background: #00b8cc; 
    transform: translateY(-2px);
}

/* ==========================================
   CONTROLE DE QUANTIDADE PERSONALIZADO (- / +)
   ========================================== */
.qty-stepper {
    display: flex;
    align-items: center;
    height: 40px;
    background: #0a0f16;
    border: 1px solid #34495e;
    border-radius: 6px;
    overflow: hidden;
    box-sizing: border-box;
}

.qty-stepper:focus-within {
    border-color: var(--cyan-accent);
}

.qty-btn {
    width: 34px;
    height: 100%;
    background: none;
    border: none;
    color: var(--cyan-accent);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.qty-btn:hover {
    background: rgba(0, 229, 255, 0.15);
    color: #fff;
}

.qty-btn:active {
    background: rgba(0, 229, 255, 0.3);
}

.qty-stepper input.product-quantity {
    width: 100% !important;
    height: 100% !important;
    border: none !important;
    background: transparent !important;
    color: #fff !important;
    font-weight: 700;
    font-size: 0.95rem;
    text-align: center;
    outline: none;
    padding: 0 !important;
    -moz-appearance: textfield;
}

.qty-stepper input.product-quantity::-webkit-outer-spin-button,
.qty-stepper input.product-quantity::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* ==========================================
   PERSONALIZADOR DE CAMISETAS (CUSTOMIZER)
   ========================================== */

/* Botão de Destaque / CTA */
.btn-open-customizer {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--cyan-accent);
    color: #000;
    font-weight: 800;
    font-size: 0.95rem;
    padding: 12px 24px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 18px;
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 15px rgba(0, 229, 255, 0.25);
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
}

.btn-open-customizer:hover {
    background: #00b8cc;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 229, 255, 0.4);
}

/* Modal do Personalizador */
.custom-modal {
    position: fixed;
    inset: 0;
    background: rgba(7, 11, 18, 0.94);
    backdrop-filter: blur(8px);
    z-index: 5500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.custom-modal.active {
    opacity: 1;
    visibility: visible;
}

.custom-modal-dialog {
    background: #0d1522;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    width: 100%;
    max-width: 980px;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
}

.custom-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 22px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(7, 11, 18, 0.95);
}

.custom-modal-header h3 {
    margin: 0;
    color: var(--cyan-accent);
    font-size: 1.15rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.custom-modal-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.4rem;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
}

.custom-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 22px;
    -webkit-overflow-scrolling: touch;
}

/* Aviso de Produção Sob Encomenda */
.custom-notice-badge {
    grid-column: 1 / -1;
    background: rgba(0, 229, 255, 0.08);
    border: 1px solid rgba(0, 229, 255, 0.3);
    color: var(--cyan-accent);
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.82rem;
    line-height: 1.4;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Seletor Frente / Costas */
.custom-view-toggle {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
    justify-content: center;
}

.btn-toggle-view {
    background: #0a0f16;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-weight: 700;
    font-size: 0.78rem;
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    transition: 0.2s;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
}

.btn-toggle-view.active {
    background: var(--cyan-accent);
    color: #000;
    border-color: var(--cyan-accent);
}

/* Previne o arrasto nativo do navegador */
.custom-stage img,
.custom-placed-art img {
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    user-drag: none;
    pointer-events: none;
}

/* Palco da Camiseta - Travado na proporção exata 1024x1536 */
.custom-stage {
    background: #070b12;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    aspect-ratio: 1024 / 1536;
    height: auto;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}

.custom-stage-bg {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Área útil de estampa DTF cobrindo 100% da imagem sem bordas limitadoras */
.custom-print-box {
    position: absolute;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    border: none !important;
    overflow: hidden;
    cursor: grab;
    touch-action: none;
    -webkit-touch-callout: none;
    user-select: none;
    -webkit-user-select: none;
}

.custom-print-box:active {
    cursor: grabbing;
}

/* Contêiner da Arte Posicionada com trava rígida máxima de 39% */
.custom-placed-art {
    position: absolute;
    top: 15%;
    left: 20%;
    max-width: 39% !important;
    cursor: move;
    transform-origin: top left;
    touch-action: none;
    -webkit-touch-callout: none;
    user-select: none;
    -webkit-user-select: none;
}

/* A estampa 8K/A3 é contida aqui sem estourar o layout */
.custom-placed-art img {
    width: 100% !important;
    height: auto !important;
    max-width: 100% !important;
    display: block;
    object-fit: contain;
}

/* Painel de Controles */
.custom-settings {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.custom-field label {
    display: block;
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
}

.custom-field select,
.custom-field input[type="text"],
.custom-field input[type="file"] {
    width: 100%;
    height: 38px;
    background: #070b12;
    color: var(--text-main);
    border: 1px solid #243b53;
    border-radius: 6px;
    padding: 6px 10px;
    font-family: inherit;
    font-size: 0.85rem;
    box-sizing: border-box;
}

.custom-field select:focus,
.custom-field input:focus {
    border-color: var(--cyan-accent);
    outline: none;
}

/* Paleta com scroll suave para abrigar as 23 cores */
.custom-color-swatches {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    max-height: 125px;
    overflow-y: auto;
    padding: 4px;
    background: rgba(7, 11, 18, 0.6);
    border: 1px solid #1c2b3d;
    border-radius: 8px;
}

.swatch-btn {
    width: 34px;
    height: 34px;
    border-radius: 6px;
    border: 2px solid #243b53;
    cursor: pointer;
    transition: transform 0.15s ease, border-color 0.15s ease;
    -webkit-tap-highlight-color: transparent;
    flex-shrink: 0;
}

.swatch-btn:hover {
    transform: scale(1.08);
}

.swatch-btn.active {
    border-color: var(--cyan-accent);
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.45);
    transform: scale(1.08);
}

.slider-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.slider-group input[type="range"] {
    flex: 1;
    accent-color: var(--cyan-accent);
    height: 6px;
    cursor: pointer;
}

.slider-val {
    font-size: 0.85rem;
    color: var(--cyan-accent);
    min-width: 65px;
    font-weight: 700;
}

/* ==========================================
   OTIMIZAÇÃO RESPONSIVA PARA SMARTPHONES
   ========================================== */
@media (max-width: 768px) {
    .custom-modal {
        padding: 8px;
    }

    .custom-modal-dialog {
        max-height: 96vh;
        height: 96vh;
    }

    .custom-modal-header {
        padding: 12px 16px;
    }

    .custom-modal-body {
        grid-template-columns: 1fr;
        padding: 14px;
        gap: 16px;
    }

    .custom-stage {
        max-width: 260px;
    }

    .custom-color-swatches {
        max-height: 105px;
    }

    .swatch-btn {
        width: 32px;
        height: 32px;
    }
}