/* style.css - COMPLETO E ATUALIZADO */

:root{ 
    --bg-color-main: #f7f7f7; 
    --card: #ffffff; 
    --accent: #d64a7b; 
    --muted-dark: #444; 
    --dark-text: #222; 
    --link-color: #007bff;
    --pix-color: #008000;
}

body{ 
    background-image: url('img/fundo-castelo.jpg'); 
    background-size: cover; 
    background-position: center bottom; 
    background-attachment: fixed; 
    background-color: var(--bg-color-main); 
    font-family:Arial,Helvetica,sans-serif; 
    margin:0; 
    padding:16px; 
    color:var(--dark-text);
}

.container{ 
    max-width:1100px; 
    margin:0 auto; 
    background-color: rgba(255, 255, 255, 0.9); 
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.1);
}

/* --- ESTILOS DO CABEÇALHO --- */
.header{ 
    display:flex; 
    justify-content:space-between; 
    align-items:center; 
    margin-bottom:20px; 
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}
.header h1 {
    font-size: 2.2em; 
    color: var(--accent); 
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1); 
    margin: 0;
}
.cart-button {
    background-color: var(--accent);
    color: white;
    border: none;
    padding: 10px 15px;
    font-size: 15px;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
    flex-shrink: 0; 
}
.cart-button:hover {
    background-color: #c7256d;
}

/* --- NOVOS ESTILOS DA BARRA DE PESQUISA --- */
.search-container {
    margin-bottom: 20px;
}
#search-bar {
    width: 100%;
    padding: 12px 15px;
    font-size: 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-sizing: border-box; /* Impede que o padding quebre o layout */
    color: var(--dark-text);
}
#search-bar:focus {
    border-color: var(--accent);
    outline: none;
}


.products-grid{ 
    display:grid; 
    grid-template-columns:repeat(auto-fill, minmax(400px,1fr)); 
    gap:25px; 
}
.product-card{ 
    background:var(--card); 
    padding:15px; 
    border-radius:10px; 
    box-shadow:0 6px 18px rgba(0,0,0,0.08); 
    display:flex;
    flex-direction:column;
    transition: transform 0.2s ease-in-out; 
}
.product-card:hover {
    transform: translateY(-5px); 
}
.product-card h2{ 
    font-size:20px; 
    margin:0 0 10px 0; 
    color:var(--accent); 
}
.card-images{
    flex-shrink: 0;
}
.card-images img{ 
    width:100%; 
    height:350px; 
    object-fit:contain; 
    border-radius:8px; 
    background-color:#f0f0f0; 
    box-shadow: 0 2px 8px rgba(0,0,0,0.05); 
}
.card-info {
    flex-grow: 1; 
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding-top: 10px;
}
.card-price-block {
    margin-top: 10px;
    margin-bottom: 15px; 
}
.card-price{ 
    font-weight:600; 
    color:#999; 
    text-decoration:line-through;
    font-size: 0.9em;
    margin-right: 8px; 
}
.card-pix{
    font-size: 1.6em; 
    font-weight: bold;
    color: var(--pix-color); 
}
.card-pix small{ 
    display:inline; 
    font-size:0.8em; 
    color:var(--muted-dark); 
    font-weight: normal;
    margin-left: 5px;
}
.card-controls{ 
    display:flex; 
    gap:10px; 
    margin-top:15px; 
    flex-wrap: wrap; 
}
.card-controls button{ 
    padding:10px 12px; 
    border-radius:8px; 
    border:1px solid #ddd; 
    cursor:pointer; 
    background:#fff; 
    text-decoration:none;
    flex-grow: 1;
    text-align: center;
    font-size: 15px; 
    font-weight: 500;
    transition: background-color 0.2s, color 0.2s, border-color 0.2s;
    color: var(--dark-text); 
}
.add-btn{ 
    background:var(--accent); 
    color:#fff; 
    border:none; 
    width: 100%; 
}
.add-btn:hover {
    background-color: #c7256d; 
}
.info-btn, .size-btn, .page-link-btn { 
    display: none; 
}


/* --- MODAIS (Comum) --- */
.modal.hidden { display: none; }
.modal { position: fixed; inset: 0; z-index: 1200; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.6); } 
.modal-panel { 
    position: relative; 
    max-width: 900px; 
    margin: 48px auto; 
    background: var(--card); 
    border-radius: 12px; 
    padding: 25px; 
    box-shadow: 0 12px 40px rgba(0,0,0,0.3); 
    z-index: 2; 
    color: var(--dark-text); 
    max-height: 80vh; 
    overflow-y: auto; 
}
.modal-close { 
    position: absolute; 
    right: 15px; 
    top: 10px; 
    background: transparent; 
    border: none; 
    font-size: 30px; 
    cursor: pointer; 
    color: #666; 
}
.modal-close:hover {
    color: var(--accent);
}

/* Estilos do Modal de Compra Unificado */
.purchase-modal-content {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}
.purchase-modal-gallery {
    flex: 1 1 300px; 
}
.purchase-modal-details {
    flex: 1 1 300px; 
    display: flex;
    flex-direction: column;
}
.modal-images { display:flex; flex-wrap: wrap; gap:10px; margin-bottom:15px; } 
.modal-images img { 
    width:100%; 
    height:auto; 
    object-fit:cover; 
    border-radius:8px; 
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.modal-prices {
    margin-top: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}
.modal-prices p {
    margin: 5px 0;
    color: var(--dark-text); 
}
.size-options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 10px; 
    margin: 15px 0;
}
#purchase-modal-size-options label{ 
    display:inline-flex; 
    align-items:center; 
    gap:8px; 
    padding:8px 12px; 
    border:1px solid #ddd; 
    border-radius:8px; 
    background:#fff; 
    cursor:pointer; 
    color: var(--dark-text); 
    font-size: 15px;
}
#purchase-modal-size-options label:hover {
    background-color: #f5f5f5;
}
#purchase-modal-size-options input{ transform:scale(1.2); } 
.size-modal-sub{ margin: 15px 0 5px 0; color:#555; }

.purchase-modal-actions {
    margin-top: auto; 
    padding-top: 20px;
}
#purchase-finalize{ 
    background:var(--accent); 
    color:#fff; 
    border:none; 
    padding:10px 15px; 
    border-radius:8px; 
    cursor:pointer; 
    width: 100%;
    font-size: 16px;
    font-weight: bold;
}
#purchase-finalize:hover {
    background-color: #c7256d;
}

/* Estilos do Modal da Sacola */
.cart-items-container {
    max-height: 400px;
    overflow-y: auto;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
    padding: 10px 0;
}
.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}
.cart-item:last-child {
    border-bottom: none;
}
.cart-item-info {
    flex-grow: 1;
}
.cart-item-info h4 {
    margin: 0 0 5px 0;
    color: var(--accent);
}
.cart-item-info p {
    margin: 0;
    font-size: 0.9em;
    color: var(--muted-dark);
}
.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--dark-text);
}
.cart-item-controls button {
    background: #f0f0f0;
    border: 1px solid #ccc;
    color: var(--dark-text);
    width: 25px;
    height: 25px;
    border-radius: 50%;
    cursor: pointer;
}
.cart-item-controls .cart-remove-item {
    background: transparent;
    border: none;
    color: var(--accent);
    font-size: 1.2em;
    margin-left: 10px;
}
.cart-total {
    margin-top: 15px;
    font-size: 1.5em;
    font-weight: bold;
    text-align: right;
    color: var(--pix-color);
}
.cart-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}
.cart-clear-btn, .cart-checkout-btn {
    padding: 10px 15px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
}
.cart-clear-btn {
    background-color: #f0f0f0;
    border: 1px solid #ccc;
    color: var(--muted-dark);
}
.cart-checkout-btn {
    background-color: #25D366; /* Cor do WhatsApp */
    color: white;
}


/* --- PAGINAÇÃO E RODAPÉ --- */
.pager { display:flex; gap:8px; justify-content:center; padding:25px 0; } 
.pager button { 
    padding:10px 15px; 
    border-radius:8px; 
    border:1px solid #ddd; 
    background:var(--card); 
    cursor:pointer; 
    font-size: 15px;
    color: var(--dark-text); 
}
.pager button[aria-current="page"] { 
    background:var(--accent); 
    color:white; 
    font-weight: bold;
}
.pager button:hover:not([aria-current="page"]) {
    background-color: #f0f0f0;
}

.site-footer { 
    margin-top:40px; 
    padding:25px; 
    border-radius:12px; 
    background: var(--muted-dark); 
    color: #fff; 
    box-shadow: 0 8px 30px rgba(0,0,0,0.06); 
    display:flex;
    flex-wrap: wrap; 
    justify-content: space-between;
    align-items: flex-start; 
}

.footer-contacts { 
    display: flex;
    flex-direction: column; 
    gap: 10px; 
    flex: 1 1 100%; 
}

.contact-item {
    font-size: 1.0em;
    color: #ddd;
}
.contact-item strong {
    color: #fff;
    margin-right: 5px;
}

.contact-item a {
    color: #fff; 
    text-decoration: underline;
}

.contact-item a:hover {
    color: var(--accent);
}

.footer-icon-img { display: none; }
.footer-qrcode { display: none; }
.address-item { display: none; } 

.footer-notice {
    flex-basis: 100%; 
    order: 3; 
    padding-top: 20px;
    margin-top: 20px;
    border-top: 1px solid #666; 
    font-size: 0.85em;
    color: #ccc;
    text-align: center;
}
.footer-notice ul {
    list-style: none;
    padding: 0;
    margin-top: 10px;
}
.footer-notice li {
    margin-bottom: 5px;
}

/* Responsividade */
@media (max-width: 900px) {
    .purchase-modal-content {
        flex-direction: column;
    }
}
@media (max-width: 768px) {
    .products-grid{ 
        grid-template-columns:1fr; 
    }
    .header {
        flex-direction: column; 
        gap: 15px;
    }
    .header h1 {
        font-size: 1.8em;
        text-align: center; 
    }
    .container {
        padding: 10px;
    }
    .site-footer {
        flex-direction: column;
        align-items: center;
        gap: 20px; 
    }
    .footer-contacts {
        min-width: unset;
        width: 100%;
        text-align: center;
        padding: 0;
        align-items: center; 
    }
    .contact-item {
        text-align: center;
    }
    .footer-notice {
        order: 3; 
        text-align: center;
    }
}