/* ============================================
   3DPrint & Grafica - CSS Principal
   Design inspirado em WoolCraft (limpo, moderno)
   ============================================ */

/* Variáveis CSS - Fácil personalização */
:root {
    /* Cores principais */
    --primary: #2D3436;
    --primary-light: #636E72;
    --secondary: #0984E3;
    --secondary-light: #74B9FF;
    --accent: #00B894;
    --accent-light: #55EFC4;

    /* Cores de estado */
    --success: #00B894;
    --warning: #FDCB6E;
    --danger: #D63031;
    --info: #0984E3;

    /* Cores neutras */
    --white: #FFFFFF;
    --gray-50: #FAFAFA;
    --gray-100: #F5F5F5;
    --gray-200: #EEEEEE;
    --gray-300: #E0E0E0;
    --gray-400: #BDBDBD;
    --gray-500: #9E9E9E;
    --gray-600: #757575;
    --gray-700: #616161;
    --gray-800: #424242;
    --gray-900: #212121;

    /* Cores de categoria */
    --cat-3d: #6C5CE7;
    --cat-seri: #E17055;
    --cat-grafica: #00B894;

    /* Tipografia */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-heading: 'Playfair Display', Georgia, serif;

    /* Espaçamento */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;

    /* Bordas */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;

    /* Sombras */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);

    /* Transições */
    --transition-fast: 0.15s ease;
    --transition-base: 0.3s ease;
    --transition-slow: 0.5s ease;

    /* Layout */
    --container-max: 1280px;
    --header-height: 72px;
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-primary);
    color: var(--gray-800);
    background-color: var(--white);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--secondary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary);
}

/* Tipografia */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    color: var(--primary);
    margin-bottom: var(--space-md);
}

h1 { font-size: 3rem; }
h2 { font-size: 2.25rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p {
    margin-bottom: var(--space-md);
    color: var(--gray-600);
}

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-sm { font-size: 0.875rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }

.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }

.text-primary { color: var(--primary); }
.text-secondary { color: var(--secondary); }
.text-accent { color: var(--accent); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }
.text-muted { color: var(--gray-500); }

/* Container */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

.container-sm { max-width: 640px; }
.container-md { max-width: 768px; }
.container-lg { max-width: 1024px; }

/* Grid System */
.grid {
    display: grid;
    gap: var(--space-lg);
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-5 { grid-template-columns: repeat(5, 1fr); }

@media (max-width: 1024px) {
    .grid-4, .grid-5 { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
    .grid-3, .grid-4, .grid-5 { grid-template-columns: repeat(2, 1fr); }
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
}

@media (max-width: 480px) {
    .grid-2, .grid-3, .grid-4, .grid-5 { grid-template-columns: 1fr; }
    .container { padding: 0 var(--space-md); }
}

/* Flexbox */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-1 { gap: var(--space-sm); }
.gap-2 { gap: var(--space-md); }
.gap-3 { gap: var(--space-lg); }
.gap-4 { gap: var(--space-xl); }

/* Spacing */
.mt-1 { margin-top: var(--space-sm); }
.mt-2 { margin-top: var(--space-md); }
.mt-3 { margin-top: var(--space-lg); }
.mt-4 { margin-top: var(--space-xl); }
.mt-5 { margin-top: var(--space-2xl); }

.mb-1 { margin-bottom: var(--space-sm); }
.mb-2 { margin-bottom: var(--space-md); }
.mb-3 { margin-bottom: var(--space-lg); }
.mb-4 { margin-bottom: var(--space-xl); }
.mb-5 { margin-bottom: var(--space-2xl); }

.p-1 { padding: var(--space-sm); }
.p-2 { padding: var(--space-md); }
.p-3 { padding: var(--space-lg); }
.p-4 { padding: var(--space-xl); }
.p-5 { padding: var(--space-2xl); }

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    z-index: 1000;
    transition: box-shadow var(--transition-base);
}

/* Esconder header no admin */
body:has(.admin-layout) .header {
    display: none;
}

body:has(.admin-layout) {
    padding-top: 0 !important;
}

.header.scrolled {
    box-shadow: var(--shadow-md);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--secondary), var(--accent));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 1.25rem;
}

/* Navegação */
.nav {
    display: flex;
    align-items: center;
    gap: var(--space-xl);
}

.nav-link {
    color: var(--gray-700);
    font-weight: 500;
    font-size: 0.95rem;
    position: relative;
    padding: var(--space-sm) 0;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--secondary);
    transition: width var(--transition-base);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-link:hover {
    color: var(--primary);
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.icon-btn {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    border: none;
    background: var(--gray-100);
    color: var(--gray-700);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.icon-btn:hover {
    background: var(--gray-200);
    color: var(--primary);
}

.badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 18px;
    height: 18px;
    background: var(--danger);
    color: var(--white);
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--primary);
    cursor: pointer;
}

@media (max-width: 768px) {
    .nav {
        display: none;
        position: absolute;
        top: var(--header-height);
        left: 0;
        right: 0;
        background: var(--white);
        flex-direction: column;
        padding: var(--space-lg);
        border-bottom: 1px solid var(--gray-200);
        box-shadow: var(--shadow-lg);
    }

    .nav.active {
        display: flex;
    }

    .menu-toggle {
        display: block;
    }
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: 0.75rem 1.5rem;
    font-family: var(--font-primary);
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: 2px solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.btn-primary:hover {
    background: var(--gray-900);
    border-color: var(--gray-900);
    color: var(--white);
}

.btn-secondary {
    background: var(--secondary);
    color: var(--white);
    border-color: var(--secondary);
}

.btn-secondary:hover {
    background: var(--info);
    border-color: var(--info);
    color: var(--white);
}

.btn-accent {
    background: var(--accent);
    color: var(--white);
    border-color: var(--accent);
}

.btn-accent:hover {
    background: var(--success);
    border-color: var(--success);
    color: var(--white);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border-color: var(--gray-300);
}

.btn-outline:hover {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.btn-ghost {
    background: transparent;
    color: var(--gray-700);
    border-color: transparent;
}

.btn-ghost:hover {
    background: var(--gray-100);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

.btn-full {
    width: 100%;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Hero Section */
.hero {
    padding-top: var(--header-height);
    min-height: 90vh;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, var(--gray-50) 0%, var(--white) 100%);
    position: relative;
    overflow: hidden;
}

/* Páginas frontend precisam de padding-top para compensar header fixo */
main {
    padding-top: var(--header-height);
}

/* Admin não precisa de padding-top no main */
body.admin-page main,
body:has(.admin-layout) main {
    padding-top: 0 !important;
}

.hero-content {
    max-width: 600px;
}

.hero-title {
    font-size: 3.5rem;
    line-height: 1.1;
    margin-bottom: var(--space-lg);
    color: var(--primary);
}

.hero-title span {
    color: var(--secondary);
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--gray-600);
    margin-bottom: var(--space-xl);
    line-height: 1.7;
}

.hero-buttons {
    display: flex;
    gap: var(--space-md);
    flex-wrap: wrap;
}

.hero-image {
    position: absolute;
    right: -5%;
    top: 50%;
    transform: translateY(-50%);
    width: 50%;
    max-width: 600px;
    opacity: 0.9;
}

.hero-shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.15;
}

.hero-shape-1 {
    width: 400px;
    height: 400px;
    background: var(--secondary);
    top: 10%;
    right: 20%;
}

.hero-shape-2 {
    width: 300px;
    height: 300px;
    background: var(--accent);
    bottom: 10%;
    right: 10%;
}

@media (max-width: 768px) {
    .hero {
        text-align: center;
        padding: calc(var(--header-height) + var(--space-xl)) var(--space-md);
    }

    .hero-title { font-size: 2.5rem; }
    .hero-subtitle { font-size: 1.1rem; }
    .hero-buttons { justify-content: center; }
    .hero-image { display: none; }
}

/* Section */
.section {
    padding: var(--space-3xl) 0;
}

.section-header {
    text-align: center;
    max-width: 600px;
    margin: 0 auto var(--space-3xl);
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: var(--space-md);
}

.section-subtitle {
    font-size: 1.1rem;
    color: var(--gray-500);
}

/* Cards */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    overflow: hidden;
    transition: all var(--transition-base);
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.card-image {
    position: relative;
    overflow: hidden;
    aspect-ratio: 4/3;
    background: var(--gray-100);
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

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

.card-badge {
    position: absolute;
    top: var(--space-md);
    left: var(--space-md);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-badge-destaque {
    background: var(--accent);
    color: var(--white);
}

.card-badge-promo {
    background: var(--danger);
    color: var(--white);
}

.card-badge-3d { background: var(--cat-3d); color: var(--white); }
.card-badge-seri { background: var(--cat-seri); color: var(--white); }
.card-badge-grafica { background: var(--cat-grafica); color: var(--white); }

.card-content {
    padding: var(--space-lg);
}

.card-category {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--secondary);
    margin-bottom: var(--space-sm);
}

.card-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: var(--space-sm);
    line-height: 1.3;
}

.card-title a {
    color: inherit;
}

.card-title a:hover {
    color: var(--secondary);
}

.card-description {
    font-size: 0.9rem;
    color: var(--gray-500);
    margin-bottom: var(--space-md);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: var(--space-md);
    border-top: 1px solid var(--gray-200);
}

.card-price {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.price-current {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}

.price-original {
    font-size: 0.9rem;
    color: var(--gray-400);
    text-decoration: line-through;
}

/* Product Detail */
.product-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3xl);
    padding-top: calc(var(--header-height) + var(--space-2xl));
}

.product-gallery {
    position: sticky;
    top: calc(var(--header-height) + var(--space-xl));
}

.product-gallery-main {
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--gray-100);
    aspect-ratio: 1;
}

.product-gallery-main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-info h1 {
    font-size: 2rem;
    margin-bottom: var(--space-md);
}

.product-meta {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid var(--gray-200);
}

.product-rating {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.star {
    color: var(--warning);
}

.product-price-large {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}

.product-price-large .original {
    font-size: 1.25rem;
    color: var(--gray-400);
    text-decoration: line-through;
    margin-left: var(--space-md);
}

.product-actions {
    display: flex;
    gap: var(--space-md);
    margin-top: var(--space-xl);
}

.quantity-selector {
    display: flex;
    align-items: center;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.quantity-selector button {
    width: 40px;
    height: 40px;
    border: none;
    background: var(--gray-100);
    cursor: pointer;
    font-size: 1.2rem;
    transition: background var(--transition-fast);
}

.quantity-selector button:hover {
    background: var(--gray-200);
}

.quantity-selector input {
    width: 50px;
    height: 40px;
    border: none;
    text-align: center;
    font-size: 1rem;
    font-weight: 600;
}

@media (max-width: 768px) {
    .product-detail {
        grid-template-columns: 1fr;
        gap: var(--space-xl);
    }

    .product-gallery {
        position: relative;
        top: 0;
    }
}

/* Features */
.features-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-xl);
}

.feature-item {
    text-align: center;
    padding: var(--space-xl);
}

.feature-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto var(--space-lg);
    background: linear-gradient(135deg, var(--secondary-light), var(--accent-light));
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
}

.feature-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: var(--space-sm);
}

.feature-desc {
    font-size: 0.9rem;
    color: var(--gray-500);
}

@media (max-width: 768px) {
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Categories */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-lg);
}

.category-card {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    aspect-ratio: 3/4;
    cursor: pointer;
}

.category-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.category-card:hover img {
    transform: scale(1.1);
}

.category-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.2) 50%, transparent 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: var(--space-xl);
    color: var(--white);
}

.category-overlay h3 {
    color: var(--white);
    margin-bottom: var(--space-sm);
}

.category-overlay p {
    color: rgba(255,255,255,0.8);
    font-size: 0.9rem;
    margin-bottom: 0;
}

@media (max-width: 768px) {
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Forms */
.form-group {
    margin-bottom: var(--space-lg);
}

.form-label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--gray-700);
    margin-bottom: var(--space-sm);
}

.form-label-required::after {
    content: ' *';
    color: var(--danger);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);
    font-family: var(--font-primary);
    font-size: 0.95rem;
    color: var(--gray-800);
    background: var(--white);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(9, 132, 227, 0.1);
}

.form-input::placeholder {
    color: var(--gray-400);
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

.form-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

.form-error {
    color: var(--danger);
    font-size: 0.85rem;
    margin-top: var(--space-xs);
}

.form-hint {
    color: var(--gray-500);
    font-size: 0.85rem;
    margin-top: var(--space-xs);
}

.input-group {
    display: flex;
}

.input-group .form-input {
    border-radius: var(--radius-md) 0 0 var(--radius-md);
    border-right: none;
}

.input-group .btn {
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

/* Checkout Steps */
.checkout-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-lg);
    margin-bottom: var(--space-3xl);
}

.step {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    color: var(--gray-400);
    font-weight: 600;
}

.step-number {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background: var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
}

.step.active {
    color: var(--secondary);
}

.step.active .step-number {
    background: var(--secondary);
    color: var(--white);
}

.step.completed {
    color: var(--accent);
}

.step.completed .step-number {
    background: var(--accent);
    color: var(--white);
}

.step-line {
    width: 40px;
    height: 2px;
    background: var(--gray-200);
}

.step-line.completed {
    background: var(--accent);
}

/* Payment Methods */
.payment-methods {
    display: grid;
    gap: var(--space-md);
}

.payment-method {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-lg);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.payment-method:hover {
    border-color: var(--secondary-light);
}

.payment-method.selected {
    border-color: var(--secondary);
    background: rgba(9, 132, 227, 0.05);
}

.payment-method input {
    width: 20px;
    height: 20px;
    accent-color: var(--secondary);
}

.payment-method-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.payment-method-info h4 {
    font-size: 1rem;
    margin-bottom: var(--space-xs);
}

.payment-method-info p {
    font-size: 0.85rem;
    color: var(--gray-500);
    margin-bottom: 0;
}

/* Chat Widget */
.chat-widget {
    position: fixed;
    bottom: var(--space-xl);
    right: var(--space-xl);
    z-index: 999;
}

.chat-toggle {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--secondary), var(--accent));
    color: var(--white);
    border: none;
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: transform var(--transition-fast);
}

.chat-toggle:hover {
    transform: scale(1.1);
}

.chat-panel {
    position: absolute;
    bottom: 70px;
    right: 0;
    width: 360px;
    height: 500px;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all var(--transition-base);
}

.chat-panel.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.chat-header {
    padding: var(--space-md) var(--space-lg);
    background: linear-gradient(135deg, var(--secondary), var(--accent));
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-header h4 {
    color: var(--white);
    margin-bottom: 0;
    font-size: 1rem;
}

.chat-close {
    background: none;
    border: none;
    color: var(--white);
    font-size: 1.25rem;
    cursor: pointer;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-lg);
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    background: var(--gray-50);
}

.chat-message {
    max-width: 80%;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-lg);
    font-size: 0.9rem;
    line-height: 1.5;
}

.chat-message.sent {
    align-self: flex-end;
    background: var(--secondary);
    color: var(--white);
    border-bottom-right-radius: var(--radius-sm);
}

.chat-message.received {
    align-self: flex-start;
    background: var(--white);
    color: var(--gray-800);
    border-bottom-left-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
}

.chat-message-time {
    font-size: 0.7rem;
    opacity: 0.7;
    margin-top: var(--space-xs);
}

.chat-input-area {
    padding: var(--space-md);
    border-top: 1px solid var(--gray-200);
    display: flex;
    gap: var(--space-sm);
}

.chat-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-full);
    font-family: var(--font-primary);
    font-size: 0.9rem;
}

.chat-input:focus {
    outline: none;
    border-color: var(--secondary);
}

.chat-send {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: var(--secondary);
    color: var(--white);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition-fast);
}

.chat-send:hover {
    background: var(--primary);
}

/* Admin Chat Panel */
.chat-conversations {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 0;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    overflow: hidden;
    height: 600px;
}

.chat-sidebar {
    background: var(--gray-50);
    border-right: 1px solid var(--gray-200);
    overflow-y: auto;
}

.chat-conversation-item {
    padding: var(--space-md);
    border-bottom: 1px solid var(--gray-200);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.chat-conversation-item:hover,
.chat-conversation-item.active {
    background: var(--white);
}

.chat-conversation-item.unread {
    border-left: 3px solid var(--secondary);
}

.chat-conversation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-xs);
}

.chat-conversation-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.chat-conversation-time {
    font-size: 0.75rem;
    color: var(--gray-400);
}

.chat-conversation-preview {
    font-size: 0.85rem;
    color: var(--gray-500);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-main {
    display: flex;
    flex-direction: column;
    background: var(--white);
}

.chat-main-header {
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-main-messages {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-lg);
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    background: var(--gray-50);
}

.chat-main-input {
    padding: var(--space-md) var(--space-lg);
    border-top: 1px solid var(--gray-200);
    display: flex;
    gap: var(--space-sm);
}

/* Tables */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    max-width: 100%;
    background: var(--white);
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    table-layout: auto;
    min-width: 600px;
}

.table th,
.table td {
    padding: var(--space-md);
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}

.table th {
    background: var(--gray-50);
    font-weight: 600;
    color: var(--gray-700);
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
}

.table tbody tr:hover {
    background: var(--gray-50);
}

.table td {
    color: var(--gray-700);
}

/* Status Badges */
.status {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
}

.status-pendente { background: #FFF3E0; color: #E65100; }
.status-pago { background: #E8F5E9; color: #2E7D32; }
.status-processamento { background: #E3F2FD; color: #1565C0; }
.status-enviado { background: #F3E5F5; color: #6A1B9A; }
.status-entregue { background: #E0F2F1; color: #00695C; }
.status-cancelado { background: #FFEBEE; color: #C62828; }

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full);
}

/* Alerts */
.alert {
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-lg);
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.alert-success {
    background: #E8F5E9;
    color: #2E7D32;
    border: 1px solid #A5D6A7;
}

.alert-warning {
    background: #FFF3E0;
    color: #E65100;
    border: 1px solid #FFCC80;
}

.alert-danger {
    background: #FFEBEE;
    color: #C62828;
    border: 1px solid #EF9A9A;
}

.alert-info {
    background: #E3F2FD;
    color: #1565C0;
    border: 1px solid #90CAF9;
}

/* Footer */
.footer {
    background: var(--primary);
    color: var(--white);
    padding: var(--space-3xl) 0 var(--space-xl);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: var(--space-2xl);
    margin-bottom: var(--space-3xl);
}

.footer-brand p {
    color: rgba(255,255,255,0.7);
    margin-top: var(--space-md);
}

.footer-title {
    color: var(--white);
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: var(--space-lg);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: var(--space-sm);
}

.footer-links a {
    color: rgba(255,255,255,0.7);
    transition: color var(--transition-fast);
}

.footer-links a:hover {
    color: var(--white);
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: var(--space-xl);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-md);
}

.footer-bottom p {
    color: rgba(255,255,255,0.5);
    margin-bottom: 0;
    font-size: 0.9rem;
}

.social-links {
    display: flex;
    gap: var(--space-md);
}

.social-links a {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    transition: background var(--transition-fast);
}

.social-links a:hover {
    background: var(--secondary);
}

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

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

    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
}

/* Admin Dashboard */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    background: var(--primary);
    color: var(--white);
    padding: var(--space-xl);
    position: fixed;
    top: 0;
    left: 0;
    width: 260px;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
}

.admin-sidebar-logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: var(--space-3xl);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.admin-nav {
    list-style: none;
}

.admin-nav-item {
    margin-bottom: var(--space-xs);
}

.admin-nav-link {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    color: rgba(255,255,255,0.7);
    font-weight: 500;
    transition: all var(--transition-fast);
}

.admin-nav-link:hover,
.admin-nav-link.active {
    background: rgba(255,255,255,0.1);
    color: var(--white);
}

.admin-nav-link i {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
}

.admin-main {
    margin-left: 260px;
    padding: var(--space-xl);
    background: var(--gray-50);
    min-height: 100vh;
    width: calc(100% - 260px);
    box-sizing: border-box;
    overflow-x: hidden;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-xl);
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid var(--gray-200);
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-lg);
    margin-bottom: var(--space-2xl);
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    border: 1px solid var(--gray-200);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--gray-500);
    margin-bottom: var(--space-sm);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-change {
    font-size: 0.85rem;
    margin-top: var(--space-sm);
}

.stat-change.positive { color: var(--success); }
.stat-change.negative { color: var(--danger); }

@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .admin-layout {
        grid-template-columns: 1fr;
    }

    .admin-sidebar {
        display: none;
    }

    .admin-main {
        margin-left: 0;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* Cart Page */
.cart-item {
    display: grid;
    grid-template-columns: 100px 1fr auto auto auto;
    gap: var(--space-lg);
    align-items: center;
    padding: var(--space-lg);
    border-bottom: 1px solid var(--gray-200);
}

.cart-item-image {
    width: 100px;
    height: 100px;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--gray-100);
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-item-info h4 {
    font-size: 1rem;
    margin-bottom: var(--space-xs);
}

.cart-item-info p {
    font-size: 0.85rem;
    color: var(--gray-500);
    margin-bottom: 0;
}

.cart-item-price {
    font-weight: 700;
    font-size: 1.1rem;
}

.cart-item-total {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--primary);
}

.cart-summary {
    background: var(--gray-50);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
}

.cart-summary-row {
    display: flex;
    justify-content: space-between;
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--gray-200);
}

.cart-summary-row:last-child {
    border-bottom: none;
    font-weight: 700;
    font-size: 1.1rem;
    padding-top: var(--space-md);
    margin-top: var(--space-md);
    border-top: 2px solid var(--gray-300);
}

@media (max-width: 768px) {
    .cart-item {
        grid-template-columns: 80px 1fr;
        gap: var(--space-md);
    }

    .cart-item-price,
    .cart-item-total,
    .cart-item .quantity-selector {
        grid-column: 2;
    }
}

/* Login / Register */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--gray-50) 0%, var(--white) 100%);
    padding: var(--space-xl);
}

.auth-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    padding: var(--space-3xl);
    width: 100%;
    max-width: 480px;
}

.auth-logo {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.auth-logo h2 {
    font-family: var(--font-heading);
    font-size: 1.75rem;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin: var(--space-xl) 0;
    color: var(--gray-400);
    font-size: 0.875rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--gray-200);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
    from { transform: translateX(-20px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.animate-fade-in {
    animation: fadeIn 0.6s ease forwards;
}

.animate-slide-in {
    animation: slideIn 0.4s ease forwards;
}

/* Loading */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--gray-300);
    border-top-color: var(--secondary);
    border-radius: var(--radius-full);
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
    background: var(--gray-400);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-500);
}

/* Utilitários */
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.rounded { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.shadow { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.border { border: 1px solid var(--gray-200); }
.bg-white { background: var(--white); }
.bg-gray-50 { background: var(--gray-50); }
.w-full { width: 100%; }
.h-full { height: 100%; }
.object-cover { object-fit: cover; }
.overflow-hidden { overflow: hidden; }
.relative { position: relative; }
.sticky { position: sticky; }
.top-0 { top: 0; }
.z-10 { z-index: 10; }


/* ============================================
   Galeria de Imagens do Produto - Miniaturas
   ============================================ */

.product-gallery-thumbs {
    display: flex;
    gap: var(--space-sm);
    margin-top: var(--space-md);
    flex-wrap: wrap;
}

.gallery-thumb {
    width: 80px;
    height: 80px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.gallery-thumb:hover {
    border-color: var(--secondary);
    transform: scale(1.05);
}

.gallery-thumb.active {
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(9, 132, 227, 0.2);
}

.gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ============================================
   SUBMENU EXPANSÍVEL
   ============================================ */

.admin-nav-item.has-submenu > .admin-nav-link {
    position: relative;
}

.submenu-arrow {
    margin-left: auto;
    font-size: 12px;
    transition: transform 0.3s ease;
    opacity: 0.7;
}

.submenu-arrow.rotated {
    transform: rotate(180deg);
}

/* Submenu - estado fechado */
.submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    opacity: 0;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 0 0 8px 8px;
}

/* Submenu - estado aberto */
.submenu.open {
    max-height: 500px;
    opacity: 1;
}

.submenu li {
    list-style: none;
}

.submenu .admin-nav-link {
    padding-left: 48px; /* indentação */
    font-size: 0.95em;
    border-left: 3px solid transparent;
}

.submenu .admin-nav-link:hover {
    background: rgba(255,255,255,0.08);
    border-left-color: var(--primary);
}

.submenu .admin-nav-link.active {
    background: rgba(255,255,255,0.1);
    border-left-color: var(--primary);
    color: var(--primary);
}

/* Item do menu pai quando ativo */
.admin-nav-link.submenu-toggle.active {
    background: rgba(255,255,255,0.1);
}

/* Badge no submenu */
.submenu .badge {
    font-size: 10px;
    padding: 2px 6px;
}

/* ============================================
   TABELAS COM SCROLL HORIZONTAL
   ============================================ */

.table-responsive {
    overflow-x: auto;
    width: 100%;
    -webkit-overflow-scrolling: touch;
}

.table-responsive::-webkit-scrollbar {
    height: 6px;
}

.table-responsive::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.table-responsive::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* ============================================
   ALERTAS FLASH
   ============================================ */

.alert {
    padding: var(--space-md);
    border-radius: 8px;
    margin-bottom: var(--space-md);
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

/* ============================================
   BADGES MELHORADOS
   ============================================ */

.badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
}

/* ============================================
   BOTÕES PEQUENOS
   ============================================ */

.btn-sm {
    padding: 6px 10px;
    font-size: 13px;
}

.btn-sm i {
    font-size: 14px;
}

/* ============================================
   LAYOUT ADMIN MELHORADO
   ============================================ */

.admin-main {
    min-width: 0; /* Importante para evitar overflow */
    overflow-x: hidden;
}

/* Garantir que o grid não quebra */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
}

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

/* Card não ultrapassa a largura */
.card {
    max-width: 100%;
    overflow: hidden;
}

/* ============================================
   CATEGORIAS - ÍCONE PREVIEW
   ============================================ */

#icone-preview {
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ============================================
   SELECT COM ÍCONES (melhorar visual)
   ============================================ */

#icone-select option {
    padding: 5px;
}

/* ============================================
   ALERTAS FLASH
   ============================================ */

.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border-color: #28a745;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border-color: #dc3545;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border-color: #ffc107;
}

/* ============================================
   TABELA CATEGORIAS
   ============================================ */

.table td {
    vertical-align: middle;
    padding: 12px;
}

.table th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
    color: #666;
    background: #f8f9fa;
}

<!-- CSS do Toggle Switch -->

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    vertical-align: middle;
    margin-right: 6px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--gray-300);
    transition: .3s;
    border-radius: var(--radius-full);
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
    box-shadow: var(--shadow-sm);
}

.toggle-switch input:checked + .toggle-slider {
    background-color: var(--accent);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

.toggle-switch input:disabled + .toggle-slider {
    opacity: 0.5;
    cursor: wait;
}

.toggle-status {
    font-size: 0.8rem;
    color: var(--gray-600);
    font-weight: 500;
}

/* Botão danger que pode faltar no CSS base */
.btn-danger {
    background: var(--danger);
    color: var(--white);
    border-color: var(--danger);
}

.btn-danger:hover {
    background: #b71c1c;
    border-color: #b71c1c;
    color: var(--white);
}
