/* Apple.com-inspired Design System */
:root {
  --color-primary: #0071e3;
  --color-primary-hover: #0077ED;
  --color-bg: #ffffff;
  --color-bg-alt: #f5f5f7;
  --color-bg-hero: #000000;
  --color-text: #1d1d1f;
  --color-text-secondary: #6e6e73;
  --color-sale: #bf4800;
  --color-success: #00875a;
  --color-border: #d2d2d7;
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --radius-pill: 980px;
  --radius-card: 18px;
  --transition: 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
  --header-height: 54px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.47059;
  font-weight: 400;
  letter-spacing: -0.022em;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--color-primary);
  text-decoration: none;
}

button {
  cursor: pointer;
  font-family: inherit;
}

/* Typography */
h1 { font-size: 48px; font-weight: 600; letter-spacing: -0.003em; line-height: 1.08349; }
h2 { font-size: 40px; font-weight: 600; letter-spacing: 0em; line-height: 1.1; }
h3 { font-size: 24px; font-weight: 600; letter-spacing: 0.009em; line-height: 1.16667; }
.text-secondary { color: var(--color-text-secondary); }

/* Layout */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.section-padding {
  padding: 80px 0;
}

/* Header */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  background-color: rgba(255, 255, 255, 0.72);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.logo {
  font-weight: 600;
  font-size: 18px;
  color: var(--color-text);
}

.header-actions {
  display: flex;
  gap: 20px;
  align-items: center;
}

.cart-icon {
  position: relative;
  cursor: pointer;
  display: flex;
  align-items: center;
}

.cart-badge {
  position: absolute;
  top: -8px;
  right: -12px;
  background-color: #e3000f;
  color: white;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 10px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 400;
  text-align: center;
  transition: var(--transition);
  border: 1px solid transparent;
}

.btn-primary {
  background-color: var(--color-primary);
  color: white;
}

.btn-primary:hover {
  background-color: var(--color-primary-hover);
}

.btn-secondary {
  background-color: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.btn-whatsapp {
  background-color: #25D366;
  color: white;
  font-weight: 600;
  font-size: 16px;
  padding: 12px 24px;
}
.btn-whatsapp:hover {
  background-color: #1DA851;
}

/* Hero Section */
.hero {
  background-color: var(--color-bg-hero);
  background-image: linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.7)), url('/images/hero_laptop.jpg');
  background-size: cover;
  background-position: center;
  color: white;
  text-align: center;
  padding: 120px 20px 60px;
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.hero h1 {
  margin-bottom: 10px;
}
.hero p {
  font-size: 24px;
  color: #a1a1a6;
  margin-bottom: 30px;
}
.hero .actions {
  display: flex;
  gap: 15px;
  z-index: 2;
}

/* Product Grid */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 24px;
  margin-top: 40px;
}

/* Product Card */
.product-card {
  background: var(--color-bg);
  border-radius: var(--radius-card);
  padding: 24px;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  border: 1px solid transparent;
  box-shadow: 0 4px 14px rgba(0,0,0,0.05);
  min-width: 0;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.product-image-wrap {
  width: 100%;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.product-image-wrap img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.product-condition {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 4px;
  margin-bottom: 10px;
  text-transform: uppercase;
}
.condition-new { background: #e3f2fd; color: #0d47a1; }
.condition-pre-owned { background: #fff3e0; color: #e65100; }

.product-name {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-specs {
  font-size: 13px;
  color: var(--color-text-secondary);
  margin-bottom: 16px;
  flex-grow: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-price {
  margin-bottom: 16px;
}

.price-original {
  font-size: 14px;
  text-decoration: line-through;
  color: var(--color-text-secondary);
}

.price-sale {
  font-size: 18px;
  font-weight: 600;
  color: var(--color-sale);
}

.price-regular {
  font-size: 18px;
  font-weight: 600;
}

/* Cart Drawer */
.cart-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(4px);
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}

.cart-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.cart-drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 100%;
  max-width: 400px;
  background: var(--color-bg);
  z-index: 1001;
  transform: translateX(100%);
  transition: transform var(--transition);
  display: flex;
  flex-direction: column;
  box-shadow: -10px 0 30px rgba(0,0,0,0.1);
}

.cart-drawer.active {
  transform: translateX(0);
}

.cart-header {
  padding: 20px;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cart-body {
  flex-grow: 1;
  overflow-y: auto;
  padding: 20px;
}

.cart-footer {
  padding: 20px;
  border-top: 1px solid var(--color-border);
  background: var(--color-bg-alt);
}

.cart-item {
  display: flex;
  gap: 15px;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--color-border);
}

.cart-item-img {
  width: 60px;
  height: 60px;
  object-fit: contain;
}

.cart-item-details {
  flex-grow: 1;
}

.cart-item-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}

.cart-qty-ctrl {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}

.cart-qty-btn {
  background: #eee;
  border: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.cart-total-row {
  display: flex;
  justify-content: space-between;
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 20px;
}

/* Skeleton loader */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeletonLoading 1.5s infinite;
  border-radius: 4px;
}
@keyframes skeletonLoading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Animations */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}
.animate-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive */
@media (max-width: 768px) {
  h1 { font-size: 36px; }
  h2 { font-size: 30px; }
  .section-padding { padding: 40px 0; }
}

/* Form & Admin */
.admin-container {
  max-width: 1000px;
  margin: 40px auto;
  padding: 20px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  font-size: 14px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
}

.form-control:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.2);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

th {
  font-weight: 600;
  font-size: 13px;
  color: var(--color-text-secondary);
}

/* Utilities */
.text-center { text-align: center; }
.mt-4 { margin-top: 32px; }
.mb-2 { margin-bottom: 16px; }
.flex { display: flex; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 16px; }
