/* Zenith Paperie Premium Design System */

:root {
  /* Colors - Light Theme */
  --bg-primary: hsl(0, 0%, 100%);
  --bg-secondary: hsl(0, 0%, 98%);
  --bg-tertiary: hsl(0, 0%, 95%);
  --text-primary: hsl(210, 15%, 15%);
  --text-secondary: hsl(210, 10%, 45%);
  --text-light: hsl(0, 0%, 100%);
  
  --primary: hsl(140, 85%, 22%); /* Forest Green */
  --primary-hover: hsl(140, 85%, 16%);
  --primary-light: hsl(140, 30%, 94%);
  
  --accent: hsl(38, 92%, 50%); /* Amber / Gold */
  --accent-hover: hsl(38, 92%, 40%);
  --accent-light: hsl(38, 92%, 95%);
  
  --border-color: hsl(0, 0%, 90%);
  --border-focus: hsl(140, 85%, 22%);
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 12px 30px rgba(0, 0, 0, 0.12);
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  
  --header-height: 80px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
}

body.dark-theme {
  /* Colors - Dark Theme */
  --bg-primary: hsl(210, 15%, 10%);
  --bg-secondary: hsl(210, 15%, 14%);
  --bg-tertiary: hsl(210, 15%, 18%);
  --text-primary: hsl(210, 15%, 90%);
  --text-secondary: hsl(210, 10%, 65%);
  
  --primary: hsl(140, 75%, 35%);
  --primary-hover: hsl(140, 75%, 45%);
  --primary-light: hsl(140, 20%, 16%);
  
  --accent: hsl(38, 92%, 60%);
  --accent-hover: hsl(38, 92%, 70%);
  --accent-light: hsl(38, 30%, 18%);
  
  --border-color: hsl(210, 15%, 20%);
  --border-focus: hsl(140, 75%, 35%);
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 12px 30px rgba(0, 0, 0, 0.4);
}

/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background-color 0.3s, color 0.3s;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
}

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

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

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

/* App Container Layout */
#app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex-grow: 1;
  padding-top: var(--header-height);
  min-height: calc(100vh - var(--header-height) - 300px);
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Common Components */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  border: none;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-heading);
}

.btn-primary {
  background-color: var(--primary);
  color: var(--text-light);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  transform: translateY(-2px);
}

.btn-secondary {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background-color: var(--border-color);
}

.btn-accent {
  background-color: var(--accent);
  color: hsl(210, 15%, 10%);
}

.btn-accent:hover {
  background-color: var(--accent-hover);
  transform: translateY(-2px);
}

.btn-link {
  background: none;
  border: none;
  color: var(--primary);
  padding: 0;
  cursor: pointer;
}

.btn-link:hover {
  text-decoration: underline;
}

/* Form Elements */
.form-group {
  margin-bottom: 20px;
}

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

.form-control {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  transition: var(--transition);
}

.form-control:focus {
  border-color: var(--border-focus);
  background-color: var(--bg-primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

/* Header & Navigation */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-height);
  background-color: rgba(var(--bg-primary), 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  z-index: 100;
  display: flex;
  align-items: center;
  transition: background-color 0.3s, border-color 0.3s;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.logo {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.5px;
}

.nav-links {
  display: flex;
  gap: 24px;
  list-style: none;
}

.nav-links a {
  font-weight: 500;
  font-size: 15px;
}

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

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.search-box {
  position: relative;
  width: 240px;
}

.search-box input {
  width: 100%;
  padding: 8px 16px 8px 36px;
  font-size: 14px;
  border-radius: 20px;
  border: 1px solid var(--border-color);
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  transition: var(--transition);
}

.search-box input:focus {
  width: 300px;
  border-color: var(--border-focus);
  background-color: var(--bg-primary);
}

.search-box svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  fill: var(--text-secondary);
  pointer-events: none;
}

.icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-primary);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  transition: var(--transition);
}

.icon-btn:hover {
  background-color: var(--bg-tertiary);
}

.cart-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  background-color: var(--accent);
  color: hsl(210, 15%, 10%);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
}

/* Search Autocomplete Suggestions */
.search-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  margin-top: 8px;
  z-index: 101;
  max-height: 300px;
  overflow-y: auto;
  display: none;
}

.suggestion-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  cursor: pointer;
  transition: var(--transition);
}

.suggestion-item:hover {
  background-color: var(--bg-secondary);
}

.suggestion-img {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  object-fit: cover;
}

.suggestion-info {
  flex-grow: 1;
}

.suggestion-title {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

.suggestion-price {
  font-size: 11px;
  color: var(--primary);
  font-weight: 600;
}

/* Hero Section */
.hero {
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--bg-secondary) 100%);
  padding: 80px 0;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 60px;
}

.hero-content {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  align-items: center;
  gap: 48px;
}

.hero-text h1 {
  font-size: 54px;
  color: var(--primary);
  margin-bottom: 24px;
  letter-spacing: -1px;
}

.hero-text p {
  font-size: 18px;
  color: var(--text-secondary);
  margin-bottom: 32px;
  max-width: 540px;
}

.hero-img {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  transform: rotate(2deg);
  transition: var(--transition);
}

.hero-img:hover {
  transform: rotate(0deg) scale(1.02);
}

/* Categories Grid */
.section-title {
  text-align: center;
  font-size: 32px;
  color: var(--primary);
  margin-bottom: 40px;
  position: relative;
}

.section-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background-color: var(--accent);
  margin: 12px auto 0;
  border-radius: 2px;
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 24px;
  margin-bottom: 80px;
}

.category-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 32px 24px;
  text-align: center;
  transition: var(--transition);
  cursor: pointer;
}

.category-card:hover {
  transform: translateY(-5px);
  background-color: var(--primary-light);
  border-color: var(--primary);
}

.category-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  color: var(--primary);
}

.category-card h3 {
  font-size: 18px;
}

/* Products Grid */
.products-section {
  margin-bottom: 80px;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 32px;
}

/* Product Card */
.product-card {
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: var(--transition);
  position: relative;
  display: flex;
  flex-direction: column;
}

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

.product-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 4px;
  z-index: 2;
  text-transform: uppercase;
}

.badge-sale {
  background-color: var(--accent);
  color: hsl(210, 15%, 10%);
}

.badge-out {
  background-color: hsl(0, 75%, 50%);
  color: white;
}

.product-img-wrapper {
  position: relative;
  padding-bottom: 100%; /* 1:1 Aspect Ratio */
  overflow: hidden;
  background-color: hsl(0, 0%, 97%);
}

.product-img-wrapper img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

.product-card:hover .product-img-wrapper img {
  transform: scale(1.08);
}

.product-card-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.product-category {
  font-size: 12px;
  color: var(--text-secondary);
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 8px;
}

.product-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 12px;
  line-height: 1.4;
  height: 44px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-rating {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 12px;
  font-size: 13px;
}

.stars {
  color: var(--accent);
  display: flex;
}

.reviews-count {
  color: var(--text-secondary);
}

.product-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
}

.product-price {
  font-size: 18px;
  font-weight: 800;
  color: var(--primary);
}

.add-to-cart-btn {
  background-color: var(--primary);
  color: white;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.add-to-cart-btn:hover {
  background-color: var(--primary-hover);
  transform: scale(1.1);
}

.add-to-cart-btn:disabled {
  background-color: var(--border-color);
  cursor: not-allowed;
}

/* Shop Page Layout */
.shop-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 40px;
  margin-top: 40px;
  margin-bottom: 80px;
}

.shop-sidebar {
  border-right: 1px solid var(--border-color);
  padding-right: 24px;
}

.filter-section {
  margin-bottom: 32px;
}

.filter-section h3 {
  font-size: 16px;
  margin-bottom: 16px;
  color: var(--primary);
}

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

.filter-item {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  cursor: pointer;
  font-size: 14px;
}

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

.price-slider-group {
  margin-top: 12px;
}

.price-values {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 13px;
  font-weight: 600;
}

.shop-content-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.catalog-info {
  font-size: 14px;
  color: var(--text-secondary);
}

.sort-dropdown select {
  padding: 8px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  cursor: pointer;
}

/* Product Details View */
.product-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  margin-bottom: 60px;
}

.product-gallery {
  position: sticky;
  top: calc(var(--header-height) + 20px);
}

.main-image-view {
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-color);
  background-color: hsl(0, 0%, 97%);
}

.product-info-panel h1 {
  font-size: 36px;
  color: var(--primary);
  margin-bottom: 16px;
}

.product-info-panel .product-price {
  font-size: 28px;
  margin-bottom: 24px;
}

.product-description-text {
  color: var(--text-secondary);
  font-size: 16px;
  margin-bottom: 32px;
  white-space: pre-line;
}

.product-meta-attributes {
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  padding: 24px 0;
  margin-bottom: 32px;
}

.attribute-row {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}

.attribute-row:last-child {
  margin-bottom: 0;
}

.attribute-label {
  font-weight: 600;
  width: 100px;
  font-size: 14px;
}

.attribute-value {
  color: var(--text-secondary);
  font-size: 14px;
}

.variant-picker {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.variant-chip {
  padding: 8px 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  font-size: 13px;
  font-weight: 600;
  background-color: var(--bg-primary);
}

.variant-chip:hover {
  border-color: var(--primary);
  background-color: var(--primary-light);
}

.variant-chip.active {
  background-color: var(--primary);
  color: white;
  border-color: var(--primary);
}

.purchase-panel {
  display: flex;
  gap: 16px;
  margin-bottom: 40px;
}

.qty-selector {
  display: flex;
  align-items: center;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.qty-btn {
  background: none;
  border: none;
  width: 44px;
  height: 44px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.qty-btn:hover {
  background-color: var(--bg-tertiary);
}

.qty-input {
  width: 50px;
  text-align: center;
  border: none;
  background: none;
  color: var(--text-primary);
  font-weight: 600;
}

/* Reviews and Tabs Section */
.details-tabs {
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 32px;
  display: flex;
  gap: 32px;
}

.tab-btn {
  background: none;
  border: none;
  padding: 16px 0;
  font-weight: 600;
  font-size: 18px;
  font-family: var(--font-heading);
  cursor: pointer;
  position: relative;
}

.tab-btn.active {
  color: var(--primary);
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 3px;
  background-color: var(--primary);
  border-radius: 2px;
}

.tab-content {
  margin-bottom: 60px;
}

.reviews-summary-block {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 40px;
  margin-bottom: 48px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 32px;
}

.rating-score h2 {
  font-size: 64px;
  color: var(--primary);
}

.write-review-card {
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 32px;
  margin-bottom: 48px;
}

.rating-select {
  display: flex;
  gap: 8px;
  font-size: 24px;
  color: var(--border-color);
  cursor: pointer;
  margin-bottom: 16px;
}

.rating-select span:hover,
.rating-select span.selected {
  color: var(--accent);
}

.review-item {
  border-bottom: 1px solid var(--border-color);
  padding: 24px 0;
}

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

.review-meta {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.reviewer-name {
  font-weight: 600;
}

.review-date {
  font-size: 13px;
  color: var(--text-secondary);
}

.review-title {
  font-weight: 700;
  margin-bottom: 8px;
}

/* Cart Page */
.cart-layout {
  display: grid;
  grid-template-columns: 1.5fr 0.8fr;
  gap: 48px;
  margin-bottom: 80px;
}

.cart-items-panel {
  border-top: 1px solid var(--border-color);
}

.cart-item {
  display: grid;
  grid-template-columns: 80px 1.5fr 1fr 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 24px 0;
  border-bottom: 1px solid var(--border-color);
}

.cart-item-img {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border-color);
  object-fit: cover;
}

.cart-item-info h3 {
  font-size: 16px;
  margin-bottom: 4px;
}

.cart-item-variant {
  font-size: 13px;
  color: var(--text-secondary);
}

.cart-summary-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 32px;
  height: fit-content;
  position: sticky;
  top: calc(var(--header-height) + 20px);
}

.summary-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 16px;
}

.summary-row.total {
  border-top: 1px solid var(--border-color);
  padding-top: 16px;
  font-size: 20px;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 24px;
}

/* Checkout View */
.checkout-layout {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 48px;
  margin-bottom: 80px;
}

.checkout-form-panel {
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 40px;
}

.checkout-summary-panel {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 32px;
  height: fit-content;
  position: sticky;
  top: calc(var(--header-height) + 20px);
}

/* Receipt / Confirmation Page */
.confirmation-card {
  max-width: 600px;
  margin: 60px auto 100px;
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 48px;
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.success-icon {
  width: 72px;
  height: 72px;
  background-color: var(--primary-light);
  color: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
}

.receipt-details {
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: left;
  margin: 32px 0;
  background-color: var(--bg-secondary);
}

.receipt-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 14px;
}

.receipt-row.total {
  border-top: 1px dashed var(--border-color);
  padding-top: 12px;
  font-weight: 800;
  color: var(--primary);
}

/* Footer */
footer {
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 60px 0 30px;
  margin-top: 80px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-col h3 {
  font-size: 18px;
  margin-bottom: 20px;
  color: var(--primary);
}

.footer-col p {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 16px;
}

.footer-col ul {
  list-style: none;
}

.footer-col ul li {
  margin-bottom: 12px;
  font-size: 14px;
  color: var(--text-secondary);
}

.footer-col ul li a:hover {
  color: var(--primary);
}

.footer-bottom {
  border-top: 1px solid var(--border-color);
  padding-top: 30px;
  text-align: center;
  font-size: 13px;
  color: var(--text-secondary);
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Responsive Styles */
@media (max-width: 992px) {
  .hero-content {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hero-text p {
    margin-left: auto;
    margin-right: auto;
  }
  .shop-layout {
    grid-template-columns: 1fr;
  }
  .shop-sidebar {
    border-right: none;
    border-bottom: 1px solid var(--border-color);
    padding-right: 0;
    padding-bottom: 24px;
  }
  .product-details {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .product-gallery {
    position: static;
  }
  .cart-layout,
  .checkout-layout {
    grid-template-columns: 1fr;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 576px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .cart-item {
    grid-template-columns: 60px 1fr auto;
    gap: 16px;
  }
  .cart-item-qty-cell,
  .cart-item-price-cell {
    grid-column: 2;
  }
  .hero-text h1 {
    font-size: 36px;
  }
}
