:root {
    /* Colors - Conecta Escolar Theme */
    --primary: #4a8b5c;
    --primary-dark: #3a7049;
    --primary-light: #e8f5ec;
    --secondary: #f7941d;
    --secondary-dark: #d67d15;
    --accent: #2c5f7c;

    /* Neutrals */
    --white: #ffffff;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;

    /* Semantic */
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --info: #3b82f6;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

    /* Spacing */
    --radius: 0.625rem;
    --radius-sm: 0.375rem;
    --radius-lg: 0.875rem;
    --radius-xl: 1rem;

    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
    background: var(--gray-50);
    color: var(--gray-900);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Utilities */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

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

.btn-secondary:hover {
    background: var(--secondary-dark);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

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

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

.btn-lg {
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 9999px;
    background: var(--secondary);
    color: var(--gray-900);
}

/* Header */
.header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
}

.header-content {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    height: 5.5rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    flex-shrink: 0;
}

.logo img {
    height: 4.0rem;
    width: auto;
}

.search-bar {
    flex: 1;
    max-width: 500px;
    position: relative;
}

.search-bar input {
    width: 100%;
    padding: 0.625rem 1rem 0.625rem 2.75rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 0.875rem;
    transition: all 0.2s;
}

.search-bar input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.search-bar i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
}

.cart-button {
    position: relative;
}

.cart-badge {
    position: absolute;
    top: -0.375rem;
    right: -0.375rem;
    background: var(--secondary);
    color: var(--gray-900);
    font-size: 0.625rem;
    font-weight: 700;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Category Navigation in Header */
.category-nav-header {
    background: var(--white);
    border-top: 1px solid var(--gray-200);
    padding: 0.75rem 0;
}

.category-list-header {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    scrollbar-width: none;
    align-items: center;
    scroll-behavior: smooth;
    padding: 0 10px;
}

.category-list-header::-webkit-scrollbar {
    display: none;
}

.category-nav-container {
    position: relative;
    display: flex;
    align-items: center;
}

.category-scroll-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 50%;
    display: none;
    /* Ativado via JS se houver overflow */
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    box-shadow: var(--shadow-sm);
    color: var(--gray-600);
    transition: all 0.2s;
}

.category-scroll-btn:hover {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

.category-scroll-btn.prev {
    left: -10px;
}

.category-scroll-btn.next {
    right: -10px;
}

/* Gradiente de fade para indicar que há mais itens */
.category-nav-container::before,
.category-nav-container::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 40px;
    pointer-events: none;
    z-index: 5;
    transition: opacity 0.3s;
    opacity: 0;
}

.category-nav-container::before {
    left: 0;
    background: linear-gradient(to right, white, transparent);
}

.category-nav-container::after {
    right: 0;
    background: linear-gradient(to left, white, transparent);
}

.category-nav-container.can-scroll-left::before {
    opacity: 1;
}

.category-nav-container.can-scroll-right::after {
    opacity: 1;
}

.category-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s;
    background: transparent;
    border: none;
    color: var(--gray-700);
    text-decoration: none;
    /* para <a> */
}

.category-item:hover {
    background: var(--gray-100);
    color: var(--gray-900);
}

.category-item.active {
    background: var(--primary);
    color: var(--white);
}

.category-item i {
    font-size: 1rem;
}

/* Category Dropdown */
.category-dropdown {
    position: relative;
}

.category-more-btn {
    background: var(--gray-100);
}

.category-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    min-width: 250px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 0.5rem;
    z-index: 100;
    max-height: 400px;
    overflow-y: auto;
}

.category-dropdown-menu.active {
    display: block;
    animation: dropdownSlideIn 0.2s ease;
}

@keyframes dropdownSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.category-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    background: transparent;
    border: none;
    color: var(--gray-700);
    text-align: left;
    text-decoration: none;
    /* para <a> */
}

.category-dropdown-item:hover {
    background: var(--gray-100);
    color: var(--gray-900);
}

.category-dropdown-item.active {
    background: var(--primary-light);
    color: var(--primary);
}

.category-dropdown-item i {
    font-size: 1rem;
    width: 1.25rem;
    text-align: center;
}

/* All Categories Modal Grid */
.all-categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
}

.category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 1.5rem 1rem;
    background: var(--gray-50);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    text-decoration: none;
    /* para <a> */
    color: inherit;
    /* herda cor do texto */
}

.category-card:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.category-card i {
    font-size: 2rem;
    color: var(--primary);
}

.category-card span {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-900);
}

/* Hero Banner */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: var(--white);
    padding: 3rem 0;
    margin-bottom: 2rem;
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.hero h1 {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.125rem;
    opacity: 0.95;
    margin-bottom: 1.5rem;
}

.hero-image {
    text-align: right;
}

.hero-image img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-lg);
}

/* Product Grid */
.products-section {
    padding: 2rem 0;
}

.section-header {
    margin-bottom: 1.5rem;
}

.section-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
}

.section-header p {
    color: var(--gray-600);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 3rem;
}

/* Product Card */
.product-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--gray-200);
    transition: all 0.3s ease;
    cursor: pointer;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.product-image {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    background: var(--gray-100);
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

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

.product-presentation {
    position: absolute;
    bottom: 0.5rem;
    left: 0.5rem;
    background: rgba(247, 148, 29, 0.95);
    color: var(--gray-900);
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.6875rem;
    font-weight: 700;
    backdrop-filter: blur(4px);
}

.product-info {
    padding: 1rem;
}

.product-name {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.product-actions .btn {
    flex: 1;
}

/* Quote Sidebar - Collapsible */
.quote-sidebar {
    position: fixed;
    right: 0;
    top: 10rem;
    bottom: 0;
    width: 60px;
    background: var(--white);
    border-left: 3px solid var(--primary);
    display: flex;
    flex-direction: column;
    z-index: 30;
    transition: width 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
}

.quote-sidebar:hover,
.quote-sidebar.expanded {
    width: 380px;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
    border-left: 1px solid var(--gray-200);
}

/* Sidebar Toggle Button */
.quote-sidebar-toggle {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    background: var(--primary);
    color: var(--white);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 2rem 0;
}

.quote-sidebar:hover .quote-sidebar-toggle,
.quote-sidebar.expanded .quote-sidebar-toggle {
    opacity: 0;
    pointer-events: none;
}

.quote-sidebar-toggle i {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.quote-sidebar-toggle-text {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    font-size: 0.875rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.quote-sidebar-toggle .cart-count {
    position: absolute;
    top: calc(1rem + 15px);
    background: var(--secondary);
    color: var(--gray-900);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 700;
    border: 3px solid var(--white);
}

/* Quote Content - Hidden when collapsed */
.quote-sidebar-content {
    opacity: 0;
    transition: opacity 0.3s ease 0.1s;
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 380px;
    height: 100%;
    overflow: hidden;
}

.quote-sidebar:hover .quote-sidebar-content,
.quote-sidebar.expanded .quote-sidebar-content {
    opacity: 1;
}

.quote-header {
    padding: 1.25rem;
    border-bottom: 1px solid var(--gray-200);
}

.quote-header h3 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--gray-900);
}

.quote-items {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    min-height: 0;
    scrollbar-width: thin;
}

.quote-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--gray-50);
    border-radius: var(--radius);
    margin-bottom: 0.75rem;
}

.quote-item-image {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    flex-shrink: 0;
}

.quote-item-info {
    flex: 1;
    min-width: 0;
}

.quote-item-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 0.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.quote-item-qty {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.qty-btn {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--gray-300);
    background: var(--white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.qty-btn:hover {
    background: var(--gray-100);
    border-color: var(--gray-400);
}

.qty-value {
    font-size: 0.875rem;
    font-weight: 600;
    min-width: 2rem;
    text-align: center;
}

.quote-footer {
    padding: 1.25rem;
    border-top: 1px solid var(--gray-200);
}

.quote-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 1rem;
    font-weight: 700;
}

/* Footer */
.footer {
    background: var(--gray-900);
    color: var(--gray-300);
    padding: 3rem 0 1.5rem;
    margin-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 3rem;
    margin-bottom: 2rem;
}

.footer-brand h3 {
    color: var(--white);
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

.footer-brand p {
    font-size: 0.875rem;
    line-height: 1.6;
}

.footer-section h4 {
    color: var(--white);
    font-size: 0.9375rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

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

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: var(--gray-400);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.2s;
}

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

.footer-bottom {
    padding-top: 1.5rem;
    border-top: 1px solid var(--gray-800);
    text-align: center;
    font-size: 0.8125rem;
    color: var(--gray-500);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
    padding: 2rem;
    overflow-y: auto;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--white);
    border-radius: var(--radius-xl);
    max-width: 600px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: modalSlideIn 0.3s ease;
    margin: auto;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray-500);
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--gray-100);
    color: var(--gray-900);
}

.modal-body {
    padding: 1.5rem;
}

/* Responsive */
@media (max-width: 1024px) {
    .quote-sidebar {
        width: 380px;
        transform: translateX(100%);
        transition: transform 0.3s ease;
        border-left: 1px solid var(--gray-200);
    }

    .quote-sidebar.mobile-open {
        transform: translateX(0);
    }

    .quote-sidebar-toggle {
        display: none;
    }

    .quote-sidebar-content {
        opacity: 1;
    }

    .hero-content {
        grid-template-columns: 1fr;
    }

    .hero-image {
        text-align: center;
    }
}

@media (max-width: 768px) {
    .hero h1 {
        font-size: 2rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 1rem;
    }
}

/* ── Paginação ──────────────────────────────────────────────────────────── */
.page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.25rem;
    height: 2.25rem;
    padding: 0 .5rem;
    border-radius: var(--radius);
    border: 1.5px solid var(--gray-200);
    background: var(--white);
    color: var(--gray-700);
    font-size: .875rem;
    font-weight: 500;
    text-decoration: none;
    transition: all .2s;
    cursor: pointer;
}

.page-btn:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

.page-btn-active {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--white);
    font-weight: 700;
    cursor: default;
}

.page-btn-active:hover {
    background: var(--primary);
    color: var(--white);
}

.page-btn-nav {
    font-size: .75rem;
}

.page-btn-disabled {
    opacity: .35;
    cursor: not-allowed;
    pointer-events: none;
}

.page-ellipsis {
    color: var(--gray-400);
    padding: 0 .25rem;
    line-height: 2.25rem;
}

@media (max-width: 480px) {
    .pagination {
        gap: .25rem;
    }

    .page-btn {
        min-width: 2rem;
        height: 2rem;
        font-size: .8rem;
    }
}