:root {
  --pe-red: #E3202B;
  --pe-blue: #1942C5;
  --pe-blue-light: #2F5BFF;
  --text: #111827;
  --text-secondary: #6B7280;
  --bg: #F8FAFC;
  --bg-white: #FFFFFF;
  --stroke: #E5E7EB;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --radius: 12px;
  --transition: all 0.3s ease;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 1rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1rem; }

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

a:hover {
  color: var(--pe-blue-light);
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Header */
.header {
  background: var(--bg-white);
  border-bottom: 1px solid var(--stroke);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text);
}

.logo img {
  height: 40px;
  width: auto;
}

.nav {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.nav-links {
  display: none;
  gap: 1.5rem;
  list-style: none;
}

@media (min-width: 768px) {
  .nav-links {
    display: flex;
  }
}

.nav-link {
  color: var(--text);
  font-weight: 500;
  padding: 0.5rem 0;
  border-bottom: 2px solid transparent;
  transition: var(--transition);
}

.nav-link:hover,
.nav-link.active {
  color: var(--pe-blue);
  border-bottom-color: var(--pe-blue);
}

.search-box {
  display: flex;
  align-items: center;
  background: var(--bg);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  padding: 0.5rem 1rem;
  gap: 0.5rem;
}

.search-box input {
  border: none;
  background: transparent;
  outline: none;
  width: 200px;
}

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

@media (min-width: 768px) {
  .mobile-menu-btn {
    display: none;
  }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--stroke);
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  gap: 0.5rem;
}

.btn-primary {
  background: var(--pe-blue);
  color: white;
  border-color: var(--pe-blue);
}

.btn-primary:hover {
  background: var(--pe-blue-light);
  border-color: var(--pe-blue-light);
  color: white;
}

.btn-secondary {
  background: white;
  color: var(--pe-blue);
  border-color: var(--pe-blue);
}

.btn-secondary:hover {
  background: var(--pe-blue);
  color: white;
}

.btn-success {
  background: #10B981;
  color: white;
  border-color: #10B981;
}

.btn-success:hover {
  background: #059669;
  border-color: #059669;
}

.btn-whatsapp {
  background: #25D366;
  color: white;
  border-color: #25D366;
}

.btn-whatsapp:hover {
  background: #128C7E;
  border-color: #128C7E;
}

/* Cards */
.card {
  background: var(--bg-white);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  overflow: hidden;
  transition: var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card-image {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  background: white;
  padding: 1rem;
}

.card-body {
  padding: 1rem;
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-brand {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}

/* Price */
.price {
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--text);
}

.price--promo {
  color: var(--pe-red);
}

.price--original {
  text-decoration: line-through;
  opacity: 0.6;
  font-size: 0.875rem;
  font-weight: 400;
  margin-left: 0.5rem;
}

/* Badge */
.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.badge-sale {
  background: var(--pe-red);
  color: white;
}

.badge-new {
  background: var(--pe-blue);
  color: white;
}

/* Grid */
.grid {
  display: grid;
  gap: 1.5rem;
}

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

.grid-3 {
  grid-template-columns: repeat(1, 1fr);
}

.grid-4 {
  grid-template-columns: repeat(2, 1fr);
}

@media (min-width: 640px) {
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid-4 {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1024px) {
  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
  .grid-4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Section */
.section {
  padding: 3rem 0;
}

.section-title {
  margin-bottom: 2rem;
  text-align: center;
}

/* Hero */
.hero {
  position: relative;
  background: linear-gradient(135deg, var(--pe-blue), var(--pe-blue-light));
  color: white;
  padding: 4rem 0;
  text-align: center;
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero h1 {
  color: white;
  margin-bottom: 1rem;
}

.hero p {
  font-size: 1.25rem;
  margin-bottom: 2rem;
  opacity: 0.9;
}

/* Footer */
.footer {
  background: var(--text);
  color: white;
  padding: 3rem 0 1rem;
  margin-top: 5rem;
}

.footer-content {
  display: grid;
  gap: 2rem;
  margin-bottom: 2rem;
}

@media (min-width: 768px) {
  .footer-content {
    grid-template-columns: repeat(3, 1fr);
  }
}

.footer-section h4 {
  color: white;
  margin-bottom: 1rem;
}

.footer-section p,
.footer-section a {
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 0.5rem;
}

.footer-section a:hover {
  color: white;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 1rem;
  text-align: center;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.875rem;
}

.social-links {
  display: flex;
  gap: 1rem;
}

.social-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  transition: var(--transition);
}

.social-links a:hover {
  background: var(--pe-blue);
}

/* Category Cards */
.category-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  text-align: center;
  background: white;
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  transition: var(--transition);
  cursor: pointer;
}

.category-card:hover {
  background: var(--pe-blue);
  color: white;
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.category-card:hover .category-icon {
  color: white;
}

.category-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  color: var(--pe-blue);
  transition: var(--transition);
}

.category-name {
  font-weight: 600;
  font-size: 1.125rem;
}

/* Brand Strip */
.brand-strip {
  background: white;
  padding: 2rem 0;
  border-top: 1px solid var(--stroke);
  border-bottom: 1px solid var(--stroke);
}

.brand-list {
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 2rem;
  flex-wrap: wrap;
}

.brand-item img {
  height: 40px;
  width: auto;
  opacity: 0.7;
  transition: var(--transition);
  filter: grayscale(100%);
}

.brand-item:hover img {
  opacity: 1;
  filter: grayscale(0%);
}

/* Forms */
.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--text);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  font-size: 1rem;
  transition: var(--transition);
  background: white;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--pe-blue);
  box-shadow: 0 0 0 3px rgba(25, 66, 197, 0.1);
}

/* Filter Sidebar */
.filter-sidebar {
  background: white;
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.filter-group {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--stroke);
}

.filter-group:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.filter-title {
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.filter-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.filter-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.filter-option input[type="checkbox"],
.filter-option input[type="radio"] {
  margin: 0;
}

/* Product Detail */
.product-detail {
  display: grid;
  gap: 2rem;
  margin-bottom: 3rem;
}

@media (min-width: 768px) {
  .product-detail {
    grid-template-columns: 1fr 1fr;
  }
}

.product-gallery {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.product-main-image {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  background: white;
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  padding: 2rem;
}

.product-thumbnails {
  display: flex;
  gap: 0.5rem;
}

.product-thumbnail {
  width: 80px;
  height: 80px;
  object-fit: contain;
  background: white;
  border: 1px solid var(--stroke);
  border-radius: 8px;
  padding: 0.5rem;
  cursor: pointer;
  transition: var(--transition);
}

.product-thumbnail:hover,
.product-thumbnail.active {
  border-color: var(--pe-blue);
}

.product-info h1 {
  margin-bottom: 0.5rem;
}

.product-brand {
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.product-price {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.product-price .price {
  font-size: 2rem;
}

.product-actions {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
}

.product-specs {
  background: var(--bg);
  padding: 1.5rem;
  border-radius: var(--radius);
}

.spec-list {
  list-style: none;
}

.spec-item {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--stroke);
}

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

.spec-label {
  font-weight: 500;
  color: var(--text-secondary);
}

.spec-value {
  font-weight: 600;
  color: var(--text);
}

/* Loyalty */
.loyalty-card {
  background: linear-gradient(135deg, var(--pe-blue), var(--pe-blue-light));
  color: white;
  padding: 2rem;
  border-radius: var(--radius);
  margin-bottom: 2rem;
}

.loyalty-balance {
  font-size: 3rem;
  font-weight: 700;
  margin: 1rem 0;
}

.points-history {
  background: white;
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  overflow: hidden;
}

.history-table {
  width: 100%;
  border-collapse: collapse;
}

.history-table thead {
  background: var(--bg);
}

.history-table th,
.history-table td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--stroke);
}

.history-table tbody tr:last-child td {
  border-bottom: none;
}

.points-add {
  color: #10B981;
  font-weight: 600;
}

.points-redeem {
  color: var(--pe-red);
  font-weight: 600;
}

/* Banner */
.banner {
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 2rem;
}

.banner img {
  width: 100%;
  height: auto;
  display: block;
}

/* Loading */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid var(--stroke);
  border-radius: 50%;
  border-top-color: var(--pe-blue);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Utility Classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

.hidden { display: none; }

/* Responsive Table */
@media (max-width: 640px) {
  .history-table {
    font-size: 0.875rem;
  }

  .history-table th,
  .history-table td {
    padding: 0.5rem;
  }
}