:root {
    --primary-green: #2e7b52;        
    --secondary-green: #4f9d69;    
    --highlight-yellow: #f9c74f;     
    --highlight-yellow-light: #ffd670;
    
    --bg-light: #f5f7f4;             
    --text-dark: #191919;
    --text-light: #5a5a5a;
    --text-price: #e63946;             
    --text-highlight: var(--primary-green);
    
    --card-bg: #ffffff;              
    --card-shadow: rgba(0, 0, 0, 0.1);
    --footer-bg: #2e7b52;
    --border-color: #e0e0e0;
    
    --link-color: #d4a517;
    --link-hover: #b8860b;
    
    --btn-primary-bg: var(--primary-green);
    --btn-primary-text: #ffffff;
    --btn-primary-hover: #246542;
    
    --btn-secondary-bg: var(--highlight-yellow);
    --btn-secondary-text: #191919;
    --btn-secondary-hover: #e0b43f;
    
    --success: #4f9d69;  
    --warning: #f9c74f;  
    --error: #e63946;
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.15);
}

[data-theme="dark"] {
    --primary-green: #4f9d69;       
    --secondary-green: #5ab17a;     
    --highlight-yellow: #ffd670;     
    --highlight-yellow-light: #ffe599;
    
    --bg-light: #1a1a1a;          
    --text-dark: #f0f0f0;
    --text-light: #b0b0b0;
    --text-highlight: var(--highlight-yellow);
    --card-bg: #242424;
    --card-shadow: rgba(0, 0, 0, 0.3);
    --footer-bg: #1f5d43;
    --border-color: #333333;
    
    --link-color: #ffd670;
    --link-hover: #ffe599;
    
    --btn-primary-bg: var(--primary-green);
    --btn-primary-text: #ffffff;
    --btn-primary-hover: #5ab17a;
    
    --btn-secondary-bg: var(--highlight-yellow);
    --btn-secondary-text: #1a1a1a;
    --btn-secondary-hover: #ffe599;
    
    --success: #5ab17a;   
    --warning: #ffd670;
    --error: #ff6b6b;
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
}

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
    transition: background-color 0.3s ease, color 0.3s ease;
    line-height: 1.6;
    display: grid;
    grid-template-areas:
        "header"
        "main"
        "footer";
    grid-template-rows: auto 1fr auto;
    min-height: 100vh;
}

/* ===== MAIN LAYOUT ===== */
main {
    grid-area: main;
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 2rem 1rem;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
}

section {
    background-color: var(--card-bg);
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

/* ===== PRODUTOS SECTION ===== */
.produtos {
    display: flex;
    flex-direction: column;
    padding: 2rem 1.5rem;
    gap: 1.5rem;
    min-height: 300px;
}

.produtos > h1 {
    text-align: center;
    font-size: 1.6rem;
    color: var(--text-dark);
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.prod {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 1rem;
    background-color: var(--bg-light);
    border-radius: 12px;
    padding: 1rem;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

.prod:hover {
    box-shadow: var(--shadow-sm);
}

.prod > img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 10px;
    background-color: var(--card-bg);
    box-shadow: var(--shadow-sm);
}

.descProduto {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-width: 0;
}

.desc {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.desc h1 {
    font-size: 1.1rem;
    color: var(--text-dark);
    font-weight: 600;
    line-height: 1.3;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.desc .preco {
    font-size: 1.4rem;
    color: var(--text-price);
    font-weight: 700;
    margin: 0;
}

.desc > p {
    font-size: 0.95rem;
    color: var(--text-light);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.desc > p > span {
    font-weight: 700;
    color: var(--primary-green);
    font-size: 1.05rem;
}

/* ===== BOTÕES QUANTIDADE ===== */
.btnQtd {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin: 0.25rem 0;
}

.btnMais,
.btnMenos {
    background-color: var(--primary-green);
    color: white;
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    font-size: 1.2rem;
    font-weight: 700;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    line-height: 1;
}

.btnMais:hover,
.btnMenos:hover {
    background-color: var(--btn-primary-hover);
}

.btnMais:active,
.btnMenos:active {
    transform: scale(0.95);
}

/* ===== EXCLUIR ===== */
.excluir {
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.excluir a {
    color: var(--error);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    background-color: transparent;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border: 2px solid var(--error);
}

.excluir a:hover {
    background-color: var(--error);
    color: white;
}

.excluir a:active {
    transform: scale(0.95);
}

/* ===== RESUMO COMPRAS ===== */
.resumoCompras {
    display: flex;
    flex-direction: column;
    padding: 2rem 1.5rem;
    gap: 1rem;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
}

.resumoCompras h1 {
    font-size: 1.6rem;
    color: var(--text-dark);
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-align: center;
}

.resumoCompras p {
    font-size: 1rem;
    color: var(--text-light);
    font-weight: 500;
    margin: 0.5rem 0;
    text-align: center;
}

.resumoCompras h2 {
    font-size: 2rem;
    color: var(--text-price);
    font-weight: 700;
    margin: 1rem 0;
    text-align: center;
}

.resumoCompras h2 span {
    color: var(--text-price);
}

.resumoCompras form {
    width: 100%;
    margin-top: 0.5rem;
}

.resumoCompras form button {
    background-color: var(--primary-green);
    color: white;
    outline: none;
    border: none;
    width: 100%;
    height: 52px;
    border-radius: 10px;
    transition: all 0.3s ease;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    font-family: 'Poppins', sans-serif;
    text-transform: uppercase;
}

.resumoCompras form button:hover {
    background-color: var(--btn-primary-hover);
    box-shadow: var(--shadow-md);
}

.resumoCompras form button:active {
    transform: scale(0.98);
}

.resumoCompras .btnContinuar {
    background-color: transparent;
    color: var(--primary-green);
    outline: none;
    border: 2px solid var(--primary-green);
    width: 100%;
    height: 52px;
    border-radius: 10px;
    transition: all 0.3s ease;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    text-transform: uppercase;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.resumoCompras .btnContinuar:hover {
    background-color: var(--primary-green);
    color: white;
}

.resumoCompras .btnContinuar:active {
    transform: scale(0.98);
}

/* Mensagem de carrinho vazio */
.produtos > h1[style] {
    color: var(--text-light) !important;
    font-size: 1.2rem !important;
    padding: 3rem 1rem !important;
    font-weight: 600 !important;
}

/* ===== TOAST NOTIFICATIONS ===== */
.toast-container {
    position: fixed;
    top: 100px;
    right: 20px;
    z-index: 100000001;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    background-color: var(--card-bg);
    color: var(--text-dark);
    padding: 1rem 1.25rem;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 320px;
    max-width: 420px;
    animation: slideIn 0.4s ease forwards;
    border: 2px solid var(--border-color);
}

.toast.error {
    border-color: var(--error);
}

.toast.success {
    border-color: var(--success);
}

.toast.warning {
    border-color: var(--warning);
}

.toast-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.toast.error .toast-icon {
    color: var(--error);
    background-color: rgba(230, 57, 70, 0.15);
}

.toast.success .toast-icon {
    color: var(--success);
    background-color: rgba(79, 157, 105, 0.15);
}

.toast.warning .toast-icon {
    color: var(--warning);
    background-color: rgba(249, 199, 79, 0.15);
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 4px;
}

.toast-message {
    font-size: 0.9rem;
    opacity: 0.85;
    font-weight: 500;
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: all 0.3s ease;
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-close:hover {
    background-color: var(--bg-light);
    color: var(--text-dark);
}

.toast.hiding {
    animation: slideOut 0.4s ease forwards;
}

@keyframes slideIn {
    from {
        transform: translateX(450px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(450px);
        opacity: 0;
    }
}

/* ===== RESPONSIVE DESIGN ===== */

/* Mobile pequeno (320px - 480px) */
@media (max-width: 480px) {
    main {
        padding: 1rem 0.75rem;
        gap: 1rem;
    }

    .produtos {
        padding: 1rem;
    }

    .prod {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 1rem;
    }

    .prod > img {
        width: 100%;
        max-width: 200px;
        height: 200px;
        margin: 0 auto;
    }

    .descProduto {
        gap: 1rem;
    }

    .desc {
        text-align: center;
        gap: 0.75rem;
    }

    .desc h1 {
        font-size: 1.1rem;
    }

    .desc .preco {
        font-size: 1.4rem;
    }

    .desc > p {
        font-size: 0.9rem;
        justify-content: center;
    }

    .btnQtd {
        justify-content: center;
        gap: 0.75rem;
    }

    .btnMais,
    .btnMenos {
        width: 40px;
        height: 40px;
        min-width: 40px;
        min-height: 40px;
        font-size: 1.1rem;
    }

    .excluir {
        justify-content: center;
        margin-top: 0.5rem;
    }

    .excluir a {
        width: 100%;
        max-width: 200px;
        justify-content: center;
        padding: 0.65rem 1.5rem;
    }

    .resumoCompras {
        padding: 1.5rem 1rem;
    }

    .resumoCompras h1 {
        font-size: 1.4rem;
    }

    .resumoCompras h2 {
        font-size: 1.7rem;
    }

    .resumoCompras form button {
        height: 48px;
        font-size: 0.95rem;
    }

    .resumoCompras .btnContinuar {
        height: 48px;
        font-size: 0.95rem;
    }

    .toast-container {
        top: 90px;
        right: 10px;
        left: 10px;
    }
    
    .toast {
        min-width: auto;
        max-width: 100%;
        padding: 0.9rem 1rem;
    }
}

/* Tablet (481px - 768px) */
@media (min-width: 481px) and (max-width: 768px) {
    main {
        padding: 1.5rem;
        gap: 1.25rem;
    }

    .prod {
        grid-template-columns: 110px 1fr;
    }

    .prod > img {
        width: 110px;
        height: 110px;
    }
}

/* Tablet grande e Desktop pequeno (769px - 1024px) */
@media (min-width: 769px) {
    main {
        grid-template-columns: 1fr 380px;
        padding: 2rem 1.5rem;
        gap: 2rem;
        align-items: start;
    }

    .produtos {
        padding: 2rem;
    }

    .produtos > h1 {
        font-size: 1.8rem;
        text-align: left;
    }

    .prod {
        grid-template-columns: 120px 1fr auto;
        gap: 1.25rem;
        padding: 1.25rem;
    }

    .prod > img {
        width: 120px;
        height: 120px;
    }

    .descProduto {
        flex-direction: row;
        align-items: center;
        gap: 1rem;
    }

    .desc {
        flex: 1;
    }

    .desc h1 {
        font-size: 1.2rem;
    }

    .desc .preco {
        font-size: 1.5rem;
    }

    .btnMais,
    .btnMenos {
        width: 40px;
        height: 40px;
        min-width: 40px;
        min-height: 40px;
    }

    .excluir {
        margin-left: 0;
    }

    .resumoCompras {
        position: sticky;
        top: 2rem;
        padding: 2.5rem 2rem;
    }

    .resumoCompras h1 {
        font-size: 1.8rem;
    }

    .resumoCompras h2 {
        font-size: 2.2rem;
    }

    .resumoCompras form button {
        height: 56px;
        font-size: 1.05rem;
    }

    .resumoCompras .btnContinuar {
        height: 56px;
        font-size: 1.05rem;
    }
}

/* Desktop grande (1025px+) */
@media (min-width: 1025px) {
    main {
        grid-template-columns: 1fr 420px;
        padding: 3rem 2rem;
        gap: 2.5rem;
    }

    .produtos {
        padding: 2.5rem;
    }

    .produtos > h1 {
        font-size: 2rem;
    }

    .prod {
        grid-template-columns: 140px 1fr auto;
        gap: 1.5rem;
        padding: 1.5rem;
    }

    .prod > img {
        width: 140px;
        height: 140px;
    }

    .desc h1 {
        font-size: 1.3rem;
    }

    .desc .preco {
        font-size: 1.6rem;
    }

    .desc > p {
        font-size: 1rem;
    }

    .btnMais,
    .btnMenos {
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
        font-size: 1.3rem;
    }

    .resumoCompras {
        padding: 3rem 2.5rem;
    }

    .resumoCompras h1 {
        font-size: 2rem;
    }

    .resumoCompras h2 {
        font-size: 2.4rem;
    }

    .resumoCompras form button {
        height: 60px;
        font-size: 1.1rem;
    }

    .resumoCompras .btnContinuar {
        height: 60px;
        font-size: 1.1rem;
    }
}

/* Desktop extra grande (1400px+) */
@media (min-width: 1400px) {
    .prod {
        grid-template-columns: 160px 1fr auto;
    }

    .prod > img {
        width: 160px;
        height: 160px;
    }
}