/**
 * ============================================
 * ESTILOS DA PÁGINA LISTA DE PRESENTES
 * Página com hero, grid de presentes e checkout
 * ============================================
 */

:root {
  --font-elegant: "Great Vibes", "Dancing Script", "Sacramento", cursive;
  --font-title: "Cormorant Garamond", serif;
  --font-body: "Montserrat", sans-serif;
  --primary-color: #8f957b;
  --secondary-color: #8f957b;
  --accent-color: #f5f1e8;
  --text-dark: #5a5a5a;
  --text-light: #8a8a8a;
  --bg-light: #fdfbf7;
  --white: #ffffff;
  --shadow: rgba(0, 0, 0, 0.08);
  --watercolor-green: #a8b89d;
  --watercolor-beige: #e8dcc8;
  --watercolor-sage: #b8c5a8;
}

/* ============================================
   GIFTS SECTION
   Seção com grid de presentes
   ============================================ */
.gifts-section {
  padding: 80px 20px 120px;
  background: var(--bg-light);
}

.section-title {
  font-family: var(--font-elegant);
  font-size: 3.5rem;
  font-weight: 400;
  text-align: center;
  color: var(--text-dark);
  margin-bottom: 10px;
  line-height: 1.2;
  letter-spacing: 1px;
}

.section-subtitle {
  font-family: var(--font-body);
  font-size: 1.1rem;
  text-align: center;
  color: var(--text-light);
  margin-bottom: 60px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  font-weight: 300;
  font-style: italic;
}

.gifts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 30px;
  max-width: 1200px;
  margin: 0 auto;
}

/* ============================================
   GIFT CARD
   Card individual de cada presente
   ============================================ */
.gift-card {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 0;
  overflow: hidden;
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.03);
}

.gift-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.gift-image {
  width: 100%;
  height: 350px;
  object-fit: cover;
  background: #f5f1e8;
  transition: transform 0.5s ease;
}

.gift-card:hover .gift-image {
  transform: scale(1.05);
}

.gift-info {
  padding: 20px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.gift-name {
  font-family: var(--font-title);
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--text-dark);
  margin-bottom: 10px;
  line-height: 1.3;
}

.gift-price {
  font-family: var(--font-body);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--primary-color);
  margin-bottom: 20px;
}

.btn-gift {
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 0;
  padding: 14px 24px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 100%;
  margin-top: auto;
  position: relative;
  overflow: hidden;
}

.btn-gift::after {
  content: "🎁";
  position: absolute;
  right: -30px;
  top: 50%;
  transform: translateY(-50%);
  transition: right 0.3s ease;
  opacity: 0.7;
}

.btn-gift:hover {
  background: var(--secondary-color);
  padding-right: 40px;
}

.btn-gift:hover::after {
  right: 15px;
}

.btn-gift:disabled {
  background: #ccc;
  cursor: not-allowed;
}

/* ============================================
   LOAD MORE BUTTON
   Botão para carregar mais presentes
   ============================================ */
.load-more-container {
  text-align: center;
  margin-top: 50px;
}

.btn-load-more {
  background: white;
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
  border-radius: 0;
  padding: 15px 40px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.btn-load-more:hover {
  background: var(--primary-color);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(139, 157, 124, 0.3);
}

.load-more-container.hidden {
  display: none;
}

/* ============================================
   CART BUTTON (FIXED)
   Botão flutuante do carrinho
   ============================================ */
.cart-button {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 65px;
  height: 65px;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 50%;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 4px 20px rgba(139, 157, 124, 0.3);
  }
  50% {
    box-shadow: 0 8px 30px rgba(139, 157, 124, 0.6);
  }
  100% {
    box-shadow: 0 4px 20px rgba(139, 157, 124, 0.3);
  }
}

.cart-button:hover {
  transform: scale(1.1) rotate(5deg);
  background: var(--secondary-color);
  animation: none;
}

.cart-count {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #d32f2f;
  color: white;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 600;
  border: 2px solid white;
}

/* ============================================
   CART SIDEBAR
   Sidebar lateral com resumo do carrinho
   ============================================ */
.cart-sidebar {
  position: fixed;
  top: 0;
  right: -450px;
  width: 450px;
  height: 100vh;
  background: white;
  box-shadow: -5px 0 30px rgba(0, 0, 0, 0.15);
  z-index: 1100;
  transition: right 0.3s ease;
  display: flex;
  flex-direction: column;
}

.cart-sidebar.open {
  right: 0;
}

/* Header do carrinho */
.cart-header {
  padding: 20px 25px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: white;
}

.cart-header h3 {
  font-family: var(--font-elegant);
  font-size: 2rem;
  font-weight: 400;
  color: var(--text-dark);
  margin: 0;
}

.cart-close {
  background: none;
  border: none;
  font-size: 2.2rem;
  color: var(--text-light);
  cursor: pointer;
  line-height: 1;
  padding: 0;
  width: 35px;
  height: 35px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  border-radius: 50%;
}

.cart-close:hover {
  background: #f0f0f0;
  color: #d32f2f;
  transform: rotate(90deg);
}

/* Conteúdo do carrinho */
.cart-content {
  flex-grow: 1;
  overflow-y: auto;
  padding: 25px;
  background: #fafafa;
}

.cart-empty {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-light);
}

.cart-empty svg {
  margin-bottom: 20px;
  opacity: 0.3;
  width: 80px;
  height: 80px;
}

.cart-empty p {
  font-family: var(--font-body);
  font-size: 1.1rem;
  color: #999;
}

/* Items do carrinho */
.cart-items {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.cart-item {
  display: flex;
  gap: 15px;
  padding: 15px;
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
  transition: transform 0.2s ease;
}

.cart-item:hover {
  transform: translateX(-5px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.cart-item-image {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 0;
  background: white;
  border: 1px solid var(--border-color);
}

.cart-item-info {
  flex-grow: 1;
  min-width: 0; /* Para evitar overflow */
}

.cart-item-name {
  font-family: var(--font-title);
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text-dark);
  margin-bottom: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-item-price {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  color: var(--primary-color);
}

.cart-item-remove {
  background: none;
  border: none;
  color: #d32f2f;
  cursor: pointer;
  font-size: 1.5rem;
  padding: 0 8px;
  transition: all 0.2s ease;
  align-self: center;
  line-height: 1;
}

.cart-item-remove:hover {
  transform: scale(1.2);
  color: #b71c1c;
}

/* Footer do carrinho */
.cart-footer {
  padding: 20px 25px;
  border-top: 2px solid var(--primary-color);
  background: white;
  box-shadow: 0 -5px 15px rgba(0, 0, 0, 0.03);
}

.cart-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  font-family: var(--font-body);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-dark);
}

.cart-total-value {
  color: var(--primary-color);
  font-size: 1.6rem;
  font-family: var(--font-title);
  font-weight: 600;
}

.cart-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Botões do carrinho */
.btn-primary,
.btn-secondary {
  padding: 14px 24px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
  border: none;
  border-radius: 0;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 100%;
}

.btn-primary {
  background: var(--primary-color);
  color: white;
  position: relative;
  overflow: hidden;
}

.btn-primary::after {
  content: "→";
  position: absolute;
  right: -20px;
  top: 50%;
  transform: translateY(-50%);
  transition: right 0.3s ease;
  opacity: 0;
}

.btn-primary:hover {
  background: var(--secondary-color);
  padding-right: 40px;
}

.btn-primary:hover::after {
  right: 20px;
  opacity: 1;
}

.btn-secondary {
  background: white;
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
  background: var(--primary-color);
  color: white;
}

.btn-large {
  width: 100%;
  padding: 16px;
  font-size: 1.1rem;
}

/* ============================================
   CHECKOUT MODAL
   Modal de finalização da compra
   ============================================ */
.checkout-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 1200;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(5px);
}

.checkout-modal.open {
  display: flex;
}

.checkout-content {
  background: white;
  border-radius: 0;
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 40px;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.checkout-close {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  font-size: 2.2rem;
  color: var(--text-light);
  cursor: pointer;
  line-height: 1;
  padding: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  border-radius: 50%;
  z-index: 10;
}

.checkout-close:hover {
  background: #f0f0f0;
  color: #d32f2f;
  transform: rotate(90deg);
}

.checkout-title {
  font-family: var(--font-elegant);
  font-size: 2.8rem;
  font-weight: 400;
  color: var(--text-dark);
  margin-bottom: 30px;
  text-align: center;
  line-height: 1.2;
}

/* Resumo do pedido */
.checkout-summary {
  background: var(--bg-light);
  padding: 25px;
  margin-bottom: 30px;
  border: 1px solid var(--border-color);
  border-radius: 0;
}

.checkout-summary h3 {
  font-family: var(--font-elegant);
  font-size: 1.8rem;
  font-weight: 400;
  color: var(--text-dark);
  margin-bottom: 20px;
}

.checkout-item {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-color);
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--text-dark);
}

.checkout-item:last-child {
  border-bottom: none;
}

.checkout-total {
  display: flex;
  justify-content: space-between;
  padding-top: 20px;
  margin-top: 15px;
  border-top: 2px solid var(--primary-color);
  font-family: var(--font-body);
  font-size: 1.3rem;
  font-weight: 600;
}

.checkout-total span:last-child {
  color: var(--primary-color);
  font-size: 1.8rem;
  font-family: var(--font-title);
}

/* ============================================
   CHECKOUT FORM
   Formulário de dados do comprador
   ============================================ */
.checkout-form h3 {
  font-family: var(--font-elegant);
  font-size: 2rem;
  font-weight: 400;
  color: var(--text-dark);
  margin-bottom: 25px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-dark);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-control {
  width: 100%;
  padding: 14px 18px;
  border: 1px solid #ddd;
  border-radius: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  transition: all 0.3s ease;
  background: #fcfcfc;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(139, 157, 124, 0.1);
  background: white;
}

textarea.form-control {
  resize: vertical;
  min-height: 100px;
}

/* ============================================
   RESPONSIVIDADE COMPLETA
   Ajustes para todos os dispositivos
   ============================================ */

/* Tablets e telas médias */
@media (max-width: 1024px) {
  .gifts-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
  }

  .gift-image {
    height: 350px;
  }

  .section-title {
    font-size: 3rem;
  }
}

/* Tablets pequenos e celulares grandes */
@media (max-width: 768px) {
  /* Grid de presentes */
  .gifts-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
  }

  .gifts-section {
    padding: 60px 15px 100px;
  }

  .section-title {
    font-size: 2.5rem;
  }

  .section-subtitle {
    font-size: 1rem;
    margin-bottom: 40px;
    padding: 0 15px;
  }

  .gift-image {
    height: 350px;
  }

  .gift-name {
    font-size: 1.3rem;
  }

  .gift-price {
    font-size: 1.2rem;
  }

  /* Carrinho sidebar */
  .cart-sidebar {
    width: 100%;
    right: -100%;
  }

  .cart-header {
    padding: 15px 20px;
  }

  .cart-header h3 {
    font-size: 1.8rem;
  }

  .cart-content {
    padding: 20px;
  }

  .cart-footer {
    padding: 15px 20px;
  }

  .cart-total {
    font-size: 1.1rem;
  }

  .cart-total-value {
    font-size: 1.4rem;
  }

  /* Botões do carrinho */
  .btn-primary,
  .btn-secondary {
    padding: 12px 20px;
    font-size: 0.9rem;
  }

  /* Checkout modal */
  .checkout-content {
    padding: 30px 25px;
  }

  .checkout-title {
    font-size: 2.2rem;
  }

  .checkout-summary {
    padding: 20px;
  }

  .checkout-summary h3 {
    font-size: 1.6rem;
  }

  .checkout-total {
    font-size: 1.2rem;
  }

  .checkout-total span:last-child {
    font-size: 1.5rem;
  }

  /* Botão flutuante */
  .cart-button {
    width: 55px;
    height: 55px;
    bottom: 20px;
    right: 20px;
  }

  .cart-count {
    width: 24px;
    height: 24px;
    font-size: 0.75rem;
  }
}

/* Celulares pequenos */
@media (max-width: 576px) {
  /* Grid - 1 coluna em telas muito pequenas */
  .gifts-grid {
    grid-template-columns: 1fr;
    max-width: 350px;
    margin: 0 auto;
  }

  .gifts-section {
    padding: 50px 15px 80px;
  }

  .section-title {
    font-size: 2.2rem;
  }

  .section-subtitle {
    font-size: 0.95rem;
    margin-bottom: 30px;
  }

  .gift-image {
    height: 350px;
  }

  .gift-card {
    margin-bottom: 5px;
  }

  .gift-info {
    padding: 18px;
  }

  .gift-name {
    font-size: 1.2rem;
  }

  .gift-price {
    font-size: 1.1rem;
    margin-bottom: 15px;
  }

  .btn-gift {
    padding: 12px 20px;
    font-size: 0.85rem;
  }

  .btn-gift::after {
    display: none; /* Remove animação em mobile para performance */
  }

  /* Botão load more */
  .btn-load-more {
    padding: 12px 30px;
    font-size: 0.85rem;
  }

  /* Itens do carrinho */
  .cart-item {
    padding: 12px;
  }

  .cart-item-image {
    width: 70px;
    height: 70px;
  }

  .cart-item-name {
    font-size: 1rem;
    white-space: normal; /* Permite quebra de linha */
    line-height: 1.3;
  }

  .cart-item-price {
    font-size: 0.95rem;
  }

  .cart-item-remove {
    font-size: 1.3rem;
    padding: 0 5px;
  }

  /* Checkout modal */
  .checkout-content {
    padding: 25px 20px;
  }

  .checkout-title {
    font-size: 2rem;
    margin-bottom: 20px;
  }

  .checkout-summary h3 {
    font-size: 1.4rem;
  }

  .checkout-item {
    font-size: 0.9rem;
    padding: 10px 0;
  }

  .checkout-total {
    font-size: 1.1rem;
  }

  .checkout-total span:last-child {
    font-size: 1.3rem;
  }

  .checkout-form h3 {
    font-size: 1.6rem;
  }

  .form-group label {
    font-size: 0.85rem;
  }

  .form-control {
    padding: 12px 15px;
    font-size: 0.95rem;
  }

  /* Botão de submit do checkout */
  #submitBtn {
    padding: 14px;
    font-size: 1rem;
  }

  #submitBtn span {
    display: block;
  }
}

/* Garantia de que todos os botões são visíveis */
@media (max-width: 480px) {
  .cart-footer .cart-actions {
    flex-direction: column;
    gap: 10px;
  }

  .cart-footer .btn-secondary,
  .cart-footer .btn-primary {
    width: 100%;
    margin: 0;
    padding: 14px;
    font-size: 0.9rem;
    white-space: normal;
    word-break: break-word;
  }

  /* Ajuste para o texto do botão de pagamento */
  #submitBtn {
    white-space: normal;
    height: auto;
    min-height: 50px;
    line-height: 1.3;
    padding: 12px;
  }
  
  .gift-image {
    height: 350px;
  }
}

/* Landscape em celulares */
@media (max-width: 768px) and (orientation: landscape) {
  .cart-sidebar {
    width: 100%;
  }

  .checkout-content {
    max-height: 85vh;
  }

  .cart-item {
    padding: 10px;
  }

  .cart-item-image {
    width: 60px;
    height: 60px;
  }
  
  .gift-image {
    height: 350px;
  }
}

/* Ajuste para telas muito pequenas (menos de 360px) */
@media (max-width: 359px) {
  .gift-name {
    font-size: 1.1rem;
  }

  .gift-price {
    font-size: 1rem;
  }

  .btn-gift {
    font-size: 0.8rem;
    padding: 10px;
  }

  .cart-item-name {
    font-size: 0.9rem;
  }

  .cart-item-price {
    font-size: 0.85rem;
  }

  .cart-total {
    font-size: 1rem;
  }

  .cart-total-value {
    font-size: 1.2rem;
  }
  
  .gift-image {
    height: 350px;
  }
}

/* Suporte a telas de alta densidade */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .gift-image {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
}

/* Melhorias de acessibilidade */
@media (prefers-reduced-motion: reduce) {
  .cart-button,
  .btn-gift,
  .btn-primary,
  .btn-secondary,
  .gift-card,
  .cart-item {
    animation: none;
    transition: none;
  }

  .btn-gift:hover::after,
  .btn-primary:hover::after {
    display: none;
  }
}

/* Impressão */
@media print {
  .cart-button,
  .cart-sidebar,
  .checkout-modal,
  .btn-gift,
  .btn-load-more {
    display: none !important;
  }

  .gifts-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  
  .gift-image {
    height: 350px;
  }
}