/* --- 1. RESET BÁSICO E VARIÁVEIS --- */
:root {
    --color-background-main: #1A1A2E;
    --color-highlight-action: #E94560;
    --color-text-main: #FFFFFF;
    --color-detail-light: #90A4D4;
    --color-card-secondary: #16213E;

    --background-light: #f4f4f9;
    --text-dark: #333;
    --card-bg: #FFFFFF;
    --border-radius: 8px;
    --box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    --transition-speed: 0.3s;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: Arial, sans-serif; }

body {
    background-color: var(--background-light);
    color: var(--text-dark);
    line-height: 1.6;
}

a { text-decoration: none; color: var(--color-highlight-action); }
ul { list-style: none; }
.container { width: 90%; max-width: 1200px; margin: 0 auto; }

/* HEADER */
.main-header {
    background-color: var(--color-background-main);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
    position: sticky;
    top: 0;
    z-index: 1000;
}
.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
}
.logo { font-size: 1.8rem; font-weight: bold; color: var(--color-text-main); }

/* BUSCA */
.search-bar { position: relative; display: flex; gap: 8px; align-items: center; }
.search-bar input { padding: 8px 36px 8px 10px; border-radius: 6px; border: 1px solid rgba(0,0,0,0.12); width: 280px; }
.search-bar button { padding: 8px 10px; border-radius: 6px; border: none; background: var(--color-highlight-action, #c62828); color: #fff; cursor: pointer; }
.search-close { display: none; position: absolute; right: 50px; top: 50%; transform: translateY(-50%); background: transparent; border: none; font-size: 1.4rem; color: var(--color-text-main, #222); cursor: pointer; z-index: 30; }

/* quando a search estiver ativa (mobile) mostra o X */
.header-content.search-active .search-close { display: inline-block; color: var(--color-highlight-action); }

/* garantir que no desktop o ícone mobile não apareça */
@media (min-width: 769px) {
    .search-icon-mobile { display: none; }
}

/* ajuste mobile: exibe/oculta a barra corretamente */
@media (max-width: 768px) {
    .search-bar { display: none; flex: 1; }
    .header-content.search-active .search-bar { display: flex; order: 1; width: 100%; padding-right: 8px; }
    .search-bar input { width: 100%; }
    .hamburger-menu { display: inline-block; }
    .search-icon-mobile { display: inline-block; background: none; border: none; font-size: 1.2rem; cursor: pointer; color: var(--color-text-main); }
}

/* ICONS */
.header-actions { display: flex; align-items: center; gap: 15px; }
.icon-link, .cart-icon, .hamburger-menu {
    color: var(--color-text-main);
    font-size: 1.3rem;
    transition: color var(--transition-speed);
    cursor: pointer;
}
.icon-link:hover, .cart-icon:hover, .hamburger-menu:hover { color: var(--color-highlight-action); }
.cart-icon { display: flex; align-items: center; gap: 5px; font-size: 1.1rem; }
.cart-counter {
    background-color: var(--color-highlight-action);
    color: var(--color-text-main);
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 0.8rem;
    line-height: 1;
}

/* NAV */
.main-nav-desktop { background-color: var(--color-card-secondary); padding: 10px 0; }
.main-nav-desktop ul { display: flex; justify-content: center; gap: 40px; }
.main-nav-desktop a { color: var(--color-text-main); font-weight: bold; padding: 5px 0; display: block; transition: color var(--transition-speed); }
.main-nav-desktop a:hover { color: var(--color-highlight-action); }

.hamburger-menu { display: none; background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--color-text-main); }
.mobile-menu { display: none; background-color: var(--color-card-secondary); width: 100%; position: absolute; left: 0; box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); z-index: 999; top: 100%; }
.mobile-menu.active { display: block; }
.mobile-menu a { color: var(--color-text-main); padding: 12px 20px; display: block; border-bottom: 1px solid rgba(255,255,255,0.1); }

.search-icon-mobile { display: none; }

/* MODAL */
.modal { display: none; position: fixed; z-index: 2000; left: 0; top: 0; width: 100%; height: 100%; overflow: auto; background-color: rgba(0,0,0,0.6); justify-content: center; align-items: center; }
.modal .modal-content { background:#fff; padding:20px; border-radius:8px; max-width:480px; width:90%; position:relative; }
.close-button { position:absolute; right:10px; top:8px; background:transparent; border:none; font-size:1.6rem; cursor:pointer; }

.image-modal-content { text-align: center; padding-top: 40px; }
#modal-image { width: auto; max-width: 100%; max-height: 70vh; object-fit: contain; border-radius: var(--border-radius); margin-bottom: 10px; }
.image-description { font-size: 1.1rem; font-weight: bold; padding: 10px 0; color: var(--color-detail-light); }

/* CURTIR/STYLES CARRINHO */
.cart-items { max-height: 300px; overflow-y: auto; padding-right: 10px; }
.cart-item { display:flex; justify-content:space-between; align-items:center; gap:10px; padding:8px 0; border-bottom:1px solid rgba(0,0,0,0.05); }
.cart-item-info { display:flex; flex-direction:column; gap:4px; }
.btn-remove { background: transparent; border: 1px solid #e06; color: #e06; padding: 6px 10px; border-radius: 4px; cursor: pointer; font-size: 0.9rem; }
.btn-remove:hover { background: #e06; color: #fff; }
.cart-item-controls { display:flex; gap:6px; align-items:center; }
.btn-qty { padding:4px 8px; border-radius:4px; border:1px solid #ccc; background:#fff; cursor:pointer; }

/* HERO */
.hero-section { background: linear-gradient(to right, #16213E, #0F3460); color: var(--color-text-main); padding: 80px 0; text-align: center; margin-bottom: 40px; }
.hero-section h1 { font-size: 2.5rem; margin-bottom: 15px; }
.hero-section p { font-size: 1.1rem; margin-bottom: 30px; }
.btn-primary { display: inline-block; background-color: var(--Color-highlight-action); color: var(--color-text-main); padding: 10px 25px; border-radius: var(--border-radius); font-weight: bold; transition: background-color var(--transition-speed); }
.btn-primary:hover { background-color: #d13a52; }

/* SECTIONS & GRID */
.section-padding { padding: 40px 0 60px 0; }
.section-title { text-align: center; font-size: 2rem; color: var(--color-background-main); margin-bottom: 30px; }
.promotion-section .section-title { color: var(--color-highlight-action); }

.products-grid, .promotion-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 30px; }
.product-card { display:flex; gap:12px; align-items:flex-start; padding:12px; border:1px solid rgba(0,0,0,0.04); border-radius:6px; margin-bottom:12px; }
.product-card:hover { transform: translateY(-5px); box-shadow: 0 8px 16px rgba(0,0,0,0.5); }
.product-card img { width:96px; height:96px; object-fit:cover; border-radius:6px; }
.product-info { flex:1; display:flex; flex-direction:column; gap:6px; }
.product-name { font-weight: bold; margin-bottom: 5px; height: 40px; overflow: hidden; }
.product-category { font-size: 0.9rem; color: var(--color-detail-light); margin-bottom: 10px; }
.product-price { display:flex; gap:8px; align-items:center; }
/* cart */
.cart-item { display:flex; justify-content:space-between; align-items:center; gap:10px; padding:8px 0; border-bottom:1px solid rgba(0,0,0,0.05); }
.cart-item-info { display:flex; flex-direction:column; gap:4px; }
.btn-remove { background: transparent; border: 1px solid #e06; color: #e06; padding: 6px 10px; border-radius: 4px; cursor: pointer; font-size: 0.9rem; }
.btn-remove:hover { background: #e06; color: #fff; }
.cart-item-controls { display:flex; gap:6px; align-items:center; }
.btn-qty { padding:4px 8px; border-radius:4px; border:1px solid #ccc; background:#fff; cursor:pointer; }

/* CONTACT & FOOTER */
.contact-section { background-color: var(--color-background-main); color: var(--color-text-main); padding: 40px 0; text-align: center; }
.contact-info p { margin: 10px 0; font-size: 1.1rem; }
.contact-info i { margin-right: 10px; color: var(--color-highlight-action); }
footer { background-color: #111122; color: var(--color-detail-light); padding: 15px 0; text-align: center; font-size: 0.9rem; }

/* RESPONSIVIDADE */
.search-icon-mobile .fa-times { display: none; }

@media (max-width: 768px) {
    .search-bar { display: none; }
    .main-nav-desktop { display: none; }
    .hamburger-menu { display: block; }
    .search-icon-mobile { display: block; font-size: 1.5rem; }
    .cart-icon { font-size: 1.3rem; gap: 2px; }
    .cart-icon .fa-shopping-cart { font-size: 1.5rem; }
    .header-actions { gap: 10px; }
    .header-content.search-active .search-bar { display: flex; order: 1; flex-grow: 1; max-width: none; margin: 0 10px 0 0; }
    .header-content.search-active .logo, .header-content.search-active .icon-link:not(.search-icon-mobile), .header-content.search-active .cart-icon, .header-content.search-active .hamburger-menu { display: none; }
    .header-content.search-active .search-icon-mobile .fa-search { display: none; }
    .header-content.search-active .search-icon-mobile .fa-times { display: block; color: var(--color-highlight-action); font-size: 1.5rem; }
    .hero-section { padding: 50px 0; }
    .products-grid, .promotion-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 20px; }
    .product-card img { height: 120px; }
    .product-name { font-size: 0.9rem; height: 35px; }
    .current-price { font-size: 1.2rem; }
    .btn-add-to-cart { padding: 8px 10px; font-size: 0.9rem; }
}
