/* Reset e Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Helvetica Neue', Arial, sans-serif;
}

body {
  background-color: #fff;
  color: #333;
}


/* Banner Promocional */
.promo-banner {
  background-color: #004526;
  color: white;
  text-align: center;
  padding: 10px;
  font-size: 14px;
  font-weight: bold;
}


/* Header */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 5%;
  border-bottom: 1px solid #eee;
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 100;
}

.logo {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 2px;
}

.logo img {
  height: 52px;
  display: block;
}

.search-container {
  flex: 1;
  max-width: 400px;
  position: relative;
}

#search-input {
  width: 100%;
  padding: 10px 40px 10px 15px;
  border: 1px solid #ccc;
  border-radius: 20px;
}

.search-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: #666;
}

.user-actions {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 28px;
}

.user-actions i {
  cursor: pointer;
  transition: opacity 0.2s;
}

.user-actions i:hover {
  opacity: 0.6;
}


/* ===========================
   BANNER PRINCIPAL
=========================== */

.hero {
  width: 100%;
  background: #000;
  aspect-ratio: 1672 / 941;
  overflow: hidden;
}

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


/* ===========================
   PRODUTOS (INDEX)
=========================== */

.products-container {
  padding: 40px 5%;
  background: #fff;
}

.products-container h2 {
  margin-bottom: 30px;
  font-size: 24px;
}

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

.product-card {
  cursor: pointer;
  transition: transform 0.2s;
}

.product-card:hover {
  transform: translateY(-5px);
}

.product-card img {
  width: 100%;
  height: 280px;
  object-fit: cover;
  background: #f9f9f9;
}

.product-card h3 {
  font-size: 14px;
  margin: 10px 0 5px;
  font-weight: normal;
}

/* Estilos de Preço para os Cards (usados no script.js) */
.prices {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 5px;
}

.old-price {
  text-decoration: line-through;
  color: #999;
  font-size: 14px;
}

.new-price {
  font-weight: bold;
  color: #004526; /* Verde Lacoste */
  font-size: 20px;
}


/* ===========================
   MODAL DE PRODUTO
=========================== */

.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.6);
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: #fff;
  width: 90%;
  max-width: 900px;
  display: flex;
  position: relative;
  padding: 20px;
}

.close-modal {
  position: absolute;
  top: 10px;
  right: 20px;
  font-size: 30px;
  cursor: pointer;
}

.product-detail-layout {
  display: flex;
  gap: 40px;
  width: 100%;
}

.product-gallery {
  flex: 1;
}

.product-gallery img#main-image {
  width: 100%;
  height: auto;
  object-fit: contain;
}

.thumbnail-list {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.thumbnail-list img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  cursor: pointer;
  border: 1px solid #ddd;
}

.thumbnail-list img.active {
  border: 2px solid #004526;
}


.product-info-detail {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Estilos de Preço dentro do Modal */
.price-container {
  margin: 15px 0;
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.price-original {
  text-decoration: line-through;
  color: #999;
  font-size: 16px;
}

.price-discount {
  font-weight: bold;
  color: #004526; /* Verde Lacoste */
  font-size: 24px;
}


/* Tamanhos */

.size-selector {
  margin: 20px 0;
}

.sizes {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.size-btn {
  width: 40px;
  height: 40px;
  border: 1px solid #ccc;
  background: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.size-btn.selected {
  background: #004526;
  color: #fff;
  border-color: #004526;
}


.error-msg {
  color: red;
  font-size: 12px;
  display: none;
  margin-top: 5px;
}


/* Botões Globais */

.btn-primary {
  width: 100%;
  padding: 15px;
  background: #004526;
  color: #fff;
  border: none;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
}


.btn-secondary {
  width: 100%;
  padding: 15px;
  background: #666;
  color: #fff;
  border: none;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  margin-top: 10px;
}


/* ===========================
   POPUP CARRINHO
=========================== */

.popup {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.5);
  align-items: center;
  justify-content: center;
}

.popup-content {
  background: #fff;
  padding: 30px;
  border-radius: 8px;
  text-align: center;
  max-width: 400px;
}


/* ===========================
   CHECKOUT (LAYOUT CORRIGIDO)
=========================== */

.checkout-page-container {
  width: 100%;
  overflow-x: auto;
  padding: 40px 0;
}

.checkout-layout {
  display: grid;
  grid-template-columns: minmax(320px, 800px) 1fr;
  max-width: 1300px;
  width: 100%;
  margin: 0 auto;
  gap: 40px;
  padding: 0 20px;
}

.checkout-forms {
  min-width: 320px;
  background: #fff;
  padding: 30px;
  border-radius: 8px;
}

.checkout-summary {
  min-width: 300px;
  background: #fff;
  padding: 24px;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(0,0,0,0.05);
}

/* Títulos dentro da seção checkout */
#address-section h3,
#payment-section h3 {
  margin-bottom: 20px;
  font-size: 20px;
  font-weight: 500;
}

/* Botão "Continuar para pagamento" específico do checkout */
#btn-next-payment {
  display: block;
  width: 100%;
  padding: 15px;
  margin-bottom: 20px;
  background: #004526;
  color: white;
  border: none;
  font-weight: bold;
  cursor: pointer;
}

/* Campos de pagamento do cartão */
#card-fields {
  margin: 30px 0;
  border-top: 1px solid #eee;
  padding-top: 20px;
}

/* Resumo do Pedido */
.cart-total-box {
  margin-top: 30px;
  text-align: right;
  font-size: 18px;
  background: #f8f8f8;
  padding: 15px;
  border-radius: 6px;
}

#cart-total {
  display: block;
  font-size: 22px;
  font-weight: bold;
  color: #004526;
  margin-top: 5px;
}

/* Itens do carrinho no checkout */
.cart-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  border-bottom: 1px solid #eee;
}

.cart-item img {
  width: 60px;
  height: 60px;
  object-fit: cover;
}

.cart-item-info {
  flex: 1;
  margin-left: 15px;
}

/* Formulários Gerais */
.form-group {
  margin-bottom: 15px;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
  font-size: 14px;
}

.form-group input {
  width: 100%;
  padding: 10px;
  border: 1px solid #ccc;
}

.form-row {
  display: flex;
  gap: 15px;
}

.payment-methods {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
}

.method {
  cursor: pointer;
}

.btn-pay {
  width: 100%;
  padding: 15px;
  background: #000;
  color: #fff;
  border: none;
  font-weight: bold;
  cursor: pointer;
  margin-top: 20px;
}


/* ===========================
   FOOTER
=========================== */

footer {
  background: #f4f4f4;
  padding: 20px;
  text-align: center;
  font-size: 12px;
  color: #666;
  margin-top: 50px;
}


/* ===========================
   RESPONSIVO
=========================== */

@media (max-width: 1024px) {
  .checkout-layout {
    grid-template-columns: minmax(320px, 600px) 1fr;
  }
}

@media (max-width: 768px) {

  header {
    padding: 4px 16px;
  }

  .user-actions {
    font-size: 24px;
    gap: 20px;
  }

  .logo img {
    height: 40px;
  }


  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
  }


  .product-card img {
    height: 220px;
  }


  .modal-content {
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
  }


  /* Modal do produto compacto: tamanhos e botão visíveis sem rolar */
  .modal-content {
    padding: 12px;
  }

  .close-modal {
    top: 4px;
    right: 12px;
    font-size: 26px;
    z-index: 2;
  }

  .product-detail-layout {
    flex-direction: column;
    gap: 8px;
  }

  .product-gallery img#main-image {
    max-height: 30vh;
    width: 100%;
    object-fit: contain;
  }

  .thumbnail-list {
    margin-top: 6px;
    gap: 6px;
  }

  .thumbnail-list img {
    width: 40px;
    height: 40px;
  }

  .product-info-detail {
    justify-content: flex-start;
  }

  .product-info-detail h2,
  .product-info-detail h3 {
    font-size: 16px;
    margin: 0;
  }

  .price-container {
    margin: 6px 0;
  }

  .price-original {
    font-size: 13px;
  }

  .price-discount {
    font-size: 20px;
  }

  .size-selector {
    margin: 8px 0;
  }

  .sizes {
    margin-top: 6px;
    gap: 8px;
    flex-wrap: wrap;
  }

  .size-btn {
    width: 36px;
    height: 36px;
    font-size: 13px;
  }

  .modal .btn-primary,
  .modal .btn-secondary {
    padding: 12px;
    font-size: 15px;
  }

  .modal .btn-secondary {
    margin-top: 6px;
  }


  /* Checkout Mobile (compacto) */
  .checkout-page-container {
    padding: 15px 0;
    overflow-x: hidden;
  }

  .checkout-layout {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 0 12px;
  }

  /* Resumo/itens aparecem PRIMEIRO, antes do formulário */
  .checkout-summary {
    order: -1;
    min-width: 0;
    padding: 14px;
    max-height: 32vh;
    overflow-y: auto;
  }

  .checkout-forms {
    min-width: 0;
    padding: 16px;
  }

  #address-section h3,
  #payment-section h3 {
    font-size: 17px;
    margin-bottom: 12px;
  }

  .form-group {
    margin-bottom: 10px;
  }

  .form-group label {
    font-size: 12px;
    margin-bottom: 3px;
  }

  .form-group input {
    padding: 8px;
    font-size: 16px; /* evita zoom automático no iPhone */
  }

  /* Campos lado a lado em vez de um embaixo do outro */
  .form-row {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px;
  }

  .form-row .form-group {
    flex: 1 1 calc(50% - 5px);
    min-width: 0;
  }

  .cart-item {
    padding: 10px 0;
  }

  .cart-item img {
    width: 48px;
    height: 48px;
  }

  .cart-item-info {
    margin-left: 10px;
    font-size: 13px;
  }

  .cart-total-box {
    margin-top: 12px;
    padding: 10px;
    font-size: 15px;
  }

  #cart-total {
    font-size: 18px;
  }

  /* Endereço em grade de 2 colunas: Cidade e Bairro lado a lado */
  #address-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 10px;
  }

  #address-form > .form-row,
  #address-form > div:last-of-type,
  #address-form > #btn-next-payment {
    grid-column: 1 / -1;
  }

  #btn-next-payment,
  #btn-finalize,
  #btn-back-address {
    max-width: none;
    width: 100%;
    padding: 12px;
    margin: 6px 0 0;
  }
}



@media (max-width: 480px) {

  .promo-banner {
    font-size: 12px;
  }


  .logo img {
    height: 34px;
  }

  .user-actions {
    font-size: 22px;
    gap: 16px;
  }


  .products-container {
    padding: 25px 5%;
  }


  /* Grid 2x2 no celular */
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .product-card img {
    height: 160px;
  }

  .product-card h3 {
    font-size: 12px;
  }

  .new-price {
    font-size: 16px;
  }

  .old-price {
    font-size: 12px;
  }

}


/* ===========================
   SUGESTÕES DE ENDEREÇO (checkout)
=========================== */

.address-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: -10px;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 0 0 6px 6px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
  max-height: 240px;
  overflow-y: auto;
  z-index: 50;
}

.address-suggestion-item {
  padding: 10px 12px;
  cursor: pointer;
  border-bottom: 1px solid #eee;
  font-size: 14px;
}

.address-suggestion-item:last-child {
  border-bottom: none;
}

.address-suggestion-item:hover {
  background: #f5f5f5;
}

.address-suggestion-item small {
  display: block;
  margin-top: 2px;
  color: #777;
  font-size: 12px;
}


/* Seletor de parcelas (checkout) */
.form-group select {
  width: 100%;
  padding: 10px;
  border: 1px solid #ccc;
  background: #fff;
  font-size: 14px;
}

@media (max-width: 768px) {
  .form-group select {
    padding: 8px;
    font-size: 16px;
  }
}


/* Aviso de frete grátis (checkout) */
.free-shipping {
  grid-column: 1 / -1; /* ocupa a linha inteira na grade do mobile */
  margin: 0 0 12px;
  padding: 8px 12px;
  background: #e8f5ec;
  border: 1px solid #b7dfc3;
  border-radius: 6px;
  color: #1a7f37;
  font-size: 14px;
  font-weight: 600;
}


/* ===========================
   HEADER QUE APARECE AO ROLAR (página inicial)
=========================== */

header.header-float {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  transform: translateY(-100%);
  transition: transform 0.3s ease;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

header.header-float.visible {
  transform: translateY(0);
}