/* =========================================================================
   STYLE.CSS - Vanilla CSS for JENNA E-Commerce
   ========================================================================= */

/* --- Custom Variables --- */
:root {
  /* Colors */
  --primary: #ff85a2;
  --primary-hover: #fa6c8f;
  --secondary: #ffb3c6;
  --light-bg: #fcfcfc;
  --dark-bg: #2a2a2a;
  --text-dark: #333333;
  --text-gray: #666666;
  --text-light: #999999;
  --white: #ffffff;
  --border-color: #f0e6ea;
  
  /* Typography */
  --font-base: 'Montserrat', sans-serif;
  --font-accent: 'Poppins', sans-serif;
  
  /* Shadows & Borders */
  --shadow-sm: 0 4px 10px rgba(0, 0, 0, 0.03);
  --shadow-md: 0 8px 25px rgba(0, 0, 0, 0.05);
  --shadow-hover: 0 15px 35px rgba(255, 133, 162, 0.15);
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-pill: 50px;
  
  /* Transitions */
  --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* --- Resets & Global --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-base);
  background-color: var(--light-bg);
  color: var(--text-dark);
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

ul {
  list-style: none;
}

input, button, select {
  font-family: inherit;
  outline: none;
}

/* --- Navbar (Header) --- */
.header {
  position: sticky;
  top: 0;
  background-color: var(--white);
  box-shadow: var(--shadow-sm);
  z-index: 1000;
  padding: 15px 5%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header .logo img {
  height: 40px; /* Adjust according to real logo */
}

.nav-menu {
  display: flex;
  gap: 30px;
  align-items: center;
}

.nav-menu li a {
  font-family: var(--font-accent);
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--text-dark);
}

.nav-menu li a:hover,
.nav-menu li a.active {
  color: var(--primary);
}

.cart-icon {
  position: relative;
  font-size: 1.2rem;
}

.cart-badge {
  position: absolute;
  top: -8px;
  right: -10px;
  background-color: var(--primary);
  color: var(--white);
  font-size: 0.65rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: var(--radius-pill);
}

.mobile-toggle {
  display: none;
  font-size: 1.5rem;
  cursor: pointer;
  background: none;
  border: none;
  color: var(--text-dark);
}

/* --- Search Hero Section --- */
.hero-search {
  background: linear-gradient(135deg, #f8f9fa 0%, #fff0f5 100%);
  padding: 60px 5%;
  text-align: center;
  border-bottom: 1px solid var(--border-color);
}

.hero-search h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 25px;
  color: var(--text-dark);
}

.search-box {
  max-width: 650px;
  margin: 0 auto;
  position: relative;
  display: flex;
  box-shadow: var(--shadow-md);
  border-radius: var(--radius-pill);
  background: var(--white);
}

.search-box input {
  flex: 1;
  border: 1px solid transparent;
  padding: 15px 25px;
  border-radius: var(--radius-pill) 0 0 var(--radius-pill);
  font-size: 1rem;
  transition: var(--transition);
}

.search-box input:focus {
  border-color: var(--secondary);
}

.search-box button {
  background: var(--primary);
  color: var(--white);
  border: none;
  padding: 0 30px;
  border-radius: 0 var(--radius-pill) var(--radius-pill) 0;
  cursor: pointer;
  font-weight: 600;
  font-family: var(--font-accent);
  transition: var(--transition);
}

.search-box button:hover {
  background: var(--primary-hover);
}

/* --- Layout Principal E-Commerce --- */
.store-container {
  display: flex;
  gap: 40px;
  padding: 50px 5%;
  max-width: 1400px;
  margin: 0 auto;
  align-items: flex-start;
}

/* --- Sidebar Filtros --- */
.sidebar {
  width: 250px;
  flex-shrink: 0;
  background-color: var(--white);
  padding: 25px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  position: sticky;
  top: 100px; /* offset below header */
}

.filter-group {
  margin-bottom: 30px;
}

.filter-title {
  font-weight: 600;
  font-size: 1.1rem;
  margin-bottom: 15px;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 10px;
}

.filter-item {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  font-family: var(--font-accent);
  font-size: 0.95rem;
  color: var(--text-gray);
  cursor: pointer;
}

.filter-item:hover {
  color: var(--primary);
}

.filter-item input[type="checkbox"] {
  accent-color: var(--primary);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.price-inputs {
  display: flex;
  align-items: center;
  gap: 10px;
}

.price-inputs input {
  width: 100%;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: var(--radius-sm);
  font-family: var(--font-accent);
}

.sidebar-btn {
  width: 100%;
  padding: 12px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  cursor: pointer;
  margin-top: 10px;
  transition: var(--transition);
}

.btn-aplicar {
  background-color: var(--primary);
  color: var(--white);
  border: none;
}

.btn-aplicar:hover {
  background-color: var(--primary-hover);
  box-shadow: var(--shadow-md);
}

.btn-limpiar {
  background-color: transparent;
  color: var(--text-gray);
  border: 1px solid #ddd;
}

.btn-limpiar:hover {
  background-color: #f1f1f1;
}

/* --- Grilla de Productos --- */
.products-wrapper {
  flex-grow: 1;
}

.products-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--border-color);
}

.products-header select {
  padding: 8px 15px;
  border-radius: var(--radius-pill);
  border: 1px solid #ddd;
  font-family: var(--font-accent);
  background: var(--white);
  cursor: pointer;
}

.grid {
  display: grid;
  /* Responsividad automática en grid */
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 30px;
}

/* --- Tarjeta de Producto --- */
.card {
  background: var(--white);
  border-radius: var(--radius-md);
  border: 1px solid #fcfcfc;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  position: relative;
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-hover);
  border-color: var(--border-color);
}

.card-badge {
  position: absolute;
  top: 15px;
  left: 15px;
  background-color: var(--primary);
  color: var(--white);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  z-index: 2;
  text-transform: uppercase;
}

.card-img {
  height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background-color: var(--white);
}

.card-img img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: transform 0.5s ease;
}

.card:hover .card-img img {
  transform: scale(1.08); /* Cool zoom effect */
}

.card-info {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  border-top: 1px solid var(--border-color);
  background: linear-gradient(to bottom, #ffffff 0%, #fafafa 100%);
}

.card-category {
  font-size: 0.8rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.card-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 12px;
}

.card-title:hover {
  color: var(--primary);
}

.card-price-container {
  margin-bottom: 20px;
  margin-top: auto; /* Empuja el precio y botón al fondo */
}

.card-price {
  font-family: var(--font-accent);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--primary);
}

.card-price-old {
  text-decoration: line-through;
  color: #ccc;
  font-size: 0.9rem;
  font-weight: 400;
  margin-right: 8px;
}

.btn-add {
  display: block;
  text-align: center;
  width: 100%;
  padding: 12px;
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-family: var(--font-accent);
  cursor: pointer;
  transition: var(--transition);
}

.btn-add:hover {
  background: var(--primary);
  color: var(--white);
  box-shadow: 0 5px 15px rgba(255, 133, 162, 0.3);
}

/* --- Pagination --- */
.pagination {
  margin-top: 50px;
  display: flex;
  justify-content: center;
  gap: 10px;
}

.page-link {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--white);
  border: 1px solid var(--border-color);
  font-weight: 600;
  transition: var(--transition);
}

.page-link:hover, .page-link.active {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}

/* --- Footer --- */
.footer {
  background-color: var(--white);
  padding: 40px 5%;
  margin-top: 60px;
  border-top: 1px solid var(--border-color);
  text-align: center;
}

.footer p {
  color: var(--text-gray);
  margin-top: 15px;
  font-size: 0.95rem;
}

/* --- Product Detail Page --- */
.product-detail-container {
  display: flex;
  gap: 50px;
  max-width: 1200px;
  margin: 50px auto;
  padding: 0 5%;
}

.product-gallery {
  flex: 1;
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 30px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-color);
}

.product-gallery img {
  max-width: 100%;
  max-height: 400px;
  object-fit: contain;
}

.product-info-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.breadcrumb {
  font-size: 0.9rem;
  color: var(--text-light);
  margin-bottom: 20px;
}

.breadcrumb a {
  color: var(--primary);
}

.prod-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 15px;
  color: var(--text-dark);
}

.prod-price {
  font-family: var(--font-accent);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 20px;
}

.prod-desc {
  color: var(--text-gray);
  margin-bottom: 30px;
  font-size: 1.05rem;
}

.prod-options {
  margin-bottom: 25px;
}

.prod-options h4 {
  font-size: 1.1rem;
  margin-bottom: 10px;
}

.variant-selector {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}

.variant-btn {
  padding: 10px 20px;
  border: 1px solid #ddd;
  background: var(--white);
  border-radius: var(--radius-pill);
  cursor: pointer;
  font-family: var(--font-accent);
  transition: var(--transition);
}

.variant-btn:hover, .variant-btn.selected {
  border-color: var(--primary);
  background: #fff0f5;
  color: var(--primary);
  font-weight: 600;
}

.qty-to-cart {
  display: flex;
  gap: 20px;
  margin-bottom: 30px;
}

.qty-selector {
  display: flex;
  align-items: center;
  border: 1px solid #ddd;
  border-radius: var(--radius-pill);
  background: var(--white);
  overflow: hidden;
}

.qty-btn {
  width: 40px;
  height: 100%;
  background: transparent;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qty-btn:hover {
  background: #f1f1f1;
}

.qty-input {
  width: 50px;
  text-align: center;
  border: none;
  font-family: var(--font-accent);
  font-weight: 600;
  padding: 12px 0;
}

.btn-buy-now {
  flex-grow: 1;
  background: var(--primary);
  color: var(--white);
  border: none;
  border-radius: var(--radius-pill);
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.btn-buy-now:hover {
  background: var(--primary-hover);
  box-shadow: var(--shadow-hover);
}

/* --- Cart & Checkout Page --- */
.cart-container {
  display: flex;
  gap: 40px;
  max-width: 1200px;
  margin: 50px auto;
  padding: 0 5%;
}

.cart-items-section {
  flex: 2;
}

.cart-title {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 25px;
  color: var(--text-dark);
}

.cart-item {
  display: flex;
  align-items: center;
  gap: 20px;
  background: var(--white);
  padding: 15px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  margin-bottom: 15px;
  border: 1px solid var(--border-color);
}

.cart-item-img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  background: #fcfcfc;
  border-radius: var(--radius-sm);
  padding: 5px;
}

.cart-item-info {
  flex-grow: 1;
}

.cart-item-title {
  font-weight: 600;
  color: var(--text-dark);
  font-size: 1.05rem;
}

.cart-item-variant {
  font-size: 0.85rem;
  color: var(--text-gray);
  margin-bottom: 5px;
}

.cart-item-price {
  font-family: var(--font-accent);
  font-weight: 600;
  color: var(--primary);
  margin-top: 5px;
}

.cart-item-remove {
  color: #dc3545;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  padding: 10px;
  transition: var(--transition);
}

.cart-item-remove:hover {
  color: #a71d2a;
}

/* Summary / Checkout panel */
.cart-summary {
  flex: 1;
  background: var(--white);
  padding: 25px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  position: sticky;
  top: 100px;
  height: max-content;
}

.summary-title {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 10px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 15px;
  color: var(--text-gray);
  font-family: var(--font-accent);
}

.summary-total {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-dark);
  border-top: 1px solid var(--border-color);
  padding-top: 15px;
  margin-top: 5px;
}

/* Payment Gateways */
.payment-methods {
  margin-top: 25px;
  margin-bottom: 25px;
}

.payment-methods h4 {
  font-size: 1rem;
  margin-bottom: 15px;
}

.payment-option {
  display: flex;
  align-items: center;
  gap: 15px;
  border: 1px solid var(--border-color);
  padding: 15px;
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  cursor: pointer;
  transition: var(--transition);
  background: var(--white);
}

.payment-option:hover,
.payment-option:has(input:checked) {
  border-color: var(--primary);
  background: #fff0f5;
}

.payment-option input[type="radio"] {
  accent-color: var(--primary);
  width: 18px;
  height: 18px;
}

.payment-option span {
  flex-grow: 1;
  line-height: 1.2;
}

.payment-option i {
  font-size: 1.5rem;
  color: var(--text-gray);
}

/* =========================================================================
   MEDIA QUERIES - 100% RESPONSIVE DESIGN
   ========================================================================= */

/* Tablets & Small Desktops */
@media (max-width: 1024px) {
  .store-container {
    gap: 30px;
  }
  
  .sidebar {
    width: 220px;
  }
}

/* Tablets (portrait) & Large Phones */
@media (max-width: 850px) {
  .store-container, .cart-container {
    flex-direction: column;
  }
  
  .cart-summary {
    position: static;
  }
  
  .product-detail-container {
    flex-direction: column;
    gap: 30px;
  }

  .sidebar {
    width: 100%;
    position: static; /* No sticky on mobile to save space */
    border: none;
    box-shadow: none;
    padding: 20px 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
  }

  .filter-group {
    margin-bottom: 20px;
  }
  
  .sidebar-btn {
    width: auto;
    display: inline-block;
    padding: 10px 20px;
  }

  .hero-search h1 {
    font-size: 1.5rem;
  }
}

/* Mobile Phones */
@media (max-width: 600px) {
  .header {
    padding: 15px 20px;
  }
  
  /* Mobile Menu Toggle logic */
  .mobile-toggle {
    display: block;
  }

  .nav-menu {
    display: none; /* We will toggle this via JS */
    flex-direction: column;
    position: absolute;
    top: 70px;
    left: 0;
    width: 100%;
    background: var(--white);
    padding: 20px;
    box-shadow: 0 10px 15px rgba(0,0,0,0.05);
  }

  .nav-menu.active {
    display: flex;
  }

  .store-container {
    padding: 30px 20px;
  }

  .qty-to-cart {
    flex-direction: column;
  }
  
  .qty-selector {
    justify-content: space-between;
  }

  .products-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }

  .cart-item {
    flex-direction: column;
    text-align: center;
    position: relative;
  }

  .cart-item-info {
    width: 100%;
  }

  .cart-item-remove {
    position: absolute;
    top: 10px;
    right: 10px;
  }

  .grid {
    grid-template-columns: 1fr; /* 1 card per row on small phones */
  }

  .search-box {
    flex-direction: column;
    border-radius: var(--radius-md);
  }
  
  .search-box input {
    border-radius: var(--radius-md) var(--radius-md) 0 0;
  }
  
  .search-box button {
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    padding: 15px;
  }
}
