/* Modern, Clean & Interactive Stylesheet inspired by interactivestudying.eu */
:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --bg-elevated: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-subtle: #94a3b8;
  --border-subtle: #e2e8f0;
  --border-focus: #0d9488;
  
  --primary: #0d9488;
  --primary-hover: #0f766e;
  --primary-light: #f0fdfa;
  --primary-border: #ccfbf1;
  
  --accent-discount: #e11d48;
  --accent-discount-bg: #ffe4e6;
  --accent-discount-border: #fecdd3;
  
  --accent-success: #059669;
  --accent-success-bg: #d1fae5;
  --accent-success-border: #a7f3d0;
  
  --accent-badge: #f1f5f9;
  --accent-badge-text: #334155;
  
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Header */
header {
  background: #ffffff;
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 40;
}

.header-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #0d9488 0%, #0284c7 100%);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.25rem;
  box-shadow: 0 2px 8px rgba(13, 148, 136, 0.3);
}

.brand-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.brand-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Nav Tabs */
.nav-tabs {
  display: flex;
  background: #f1f5f9;
  padding: 0.25rem;
  border-radius: var(--radius-full);
  gap: 0.25rem;
}

.nav-tab-btn {
  border: none;
  background: transparent;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-tab-btn.active {
  background: #ffffff;
  color: var(--primary);
  box-shadow: var(--shadow-xs);
}

.basket-count-badge {
  background: var(--accent-discount);
  color: white;
  font-size: 0.7rem;
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius-full);
  font-weight: 700;
}

/* Main Container */
main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* Hero Section */
.hero-card {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
  position: relative;
  overflow: hidden;
}

.hero-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--primary);
}

.hero-stats {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.stat-box {
  background: #f8fafc;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.75rem 1.25rem;
  text-align: center;
  min-width: 110px;
}

.stat-number {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.2;
}

.stat-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Filter Controls */
.controls-card {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-sm);
}

.search-and-selects {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

@media (max-width: 900px) {
  .search-and-selects {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 600px) {
  .search-and-selects {
    grid-template-columns: 1fr;
  }
}

.input-group {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input {
  width: 100%;
  padding: 0.65rem 1rem 0.65rem 2.25rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  outline: none;
  transition: all 0.2s ease;
  background-color: #f8fafc;
}

.search-input:focus {
  background-color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}

.search-icon {
  position: absolute;
  left: 0.75rem;
  color: var(--text-subtle);
  pointer-events: none;
}

.select-control {
  width: 100%;
  padding: 0.65rem 1rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  color: var(--text-main);
  background-color: #f8fafc;
  outline: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.select-control:focus {
  border-color: var(--primary);
  background-color: #ffffff;
}

/* Filter Pills */
.line-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid #f1f5f9;
}

.pill-btn {
  background: #f1f5f9;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s ease;
}

.pill-btn:hover {
  background: #e2e8f0;
  color: var(--text-main);
}

.pill-btn.active {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary-border);
}

/* Product Grid */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1.5rem;
}

.product-card {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  position: relative;
}

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

.card-header-tags {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  gap: 0.5rem;
}

.line-tag {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: #f1f5f9;
  color: #475569;
}

.line-tag.cicalfate { background: #e0f2fe; color: #0369a1; }
.line-tag.hydrance { background: #ecfeff; color: #0e7490; }
.line-tag.hyaluron-activ-b3 { background: #fae8ff; color: #86198f; }
.line-tag.xeracalm { background: #fef3c7; color: #b45309; }
.line-tag.tolerance { background: #f0fdf4; color: #15803d; }
.line-tag.cleanance { background: #ffedd5; color: #c2410c; }
.line-tag.cold-cream { background: #f3e8ff; color: #6b21a8; }

.discount-badge {
  background: var(--accent-discount-bg);
  color: var(--accent-discount);
  border: 1px solid var(--accent-discount-border);
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
}

.product-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.35;
  margin-bottom: 0.5rem;
  min-height: 2.7rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-volume {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.pricing-block {
  background: #f8fafc;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  margin-bottom: 0.85rem;
}

.price-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.25rem;
}

.regular-price-crossed {
  font-size: 0.8rem;
  color: var(--text-subtle);
  text-decoration: line-through;
}

.promo-price {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-main);
}

.unit-price-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--accent-success-bg);
  color: var(--accent-success);
  border: 1px solid var(--accent-success-border);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
}

.store-availability-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.85rem;
}

.store-name-tag {
  font-weight: 600;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.card-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: auto;
}

.btn-add-basket {
  flex: 1;
  background: var(--primary);
  color: #ffffff;
  border: none;
  padding: 0.6rem;
  border-radius: var(--radius-md);
  font-size: 0.825rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.btn-add-basket:hover {
  background: var(--primary-hover);
  box-shadow: 0 2px 6px rgba(13, 148, 136, 0.3);
}

.btn-add-basket.in-basket {
  background: #10b981;
}

.btn-view-store {
  background: #f1f5f9;
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-md);
  font-size: 0.825rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.btn-view-store:hover {
  background: #e2e8f0;
}

/* Smart Basket Section */
.smart-basket-container {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 2rem;
}

@media (max-width: 960px) {
  .smart-basket-container {
    grid-template-columns: 1fr;
  }
}

.basket-builder-card {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.card-section-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-section-desc {
  font-size: 0.825rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.presets-container {
  margin-bottom: 1.25rem;
}

.preset-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.preset-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.preset-pill {
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  color: var(--text-main);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
}

.preset-pill:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

.add-item-form {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.btn-primary {
  background: var(--primary);
  color: white;
  border: none;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.basket-items-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 450px;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.basket-item-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  background: #f8fafc;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  gap: 0.75rem;
}

.basket-item-info {
  flex: 1;
}

.basket-item-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.3;
}

.basket-item-matched {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.basket-item-qty {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.qty-btn {
  width: 24px;
  height: 24px;
  border: 1px solid var(--border-subtle);
  background: #ffffff;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  cursor: pointer;
}

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

.btn-remove-item {
  color: #ef4444;
  background: none;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0.2rem;
}

/* Store Comparison Cards */
.store-comparisons-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 650px) {
  .store-comparisons-grid {
    grid-template-columns: 1fr;
  }
}

.store-card {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  position: relative;
  transition: all 0.2s ease;
}

.store-card.winner {
  border: 2px solid #10b981;
  background: linear-gradient(180deg, #f0fdf4 0%, #ffffff 40%);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.15);
}

.winner-banner {
  position: absolute;
  top: -10px;
  right: 12px;
  background: #10b981;
  color: white;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 0.25rem;
  box-shadow: var(--shadow-xs);
}

.store-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.store-card-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
}

.store-card-country {
  font-size: 0.7rem;
  color: var(--text-muted);
  background: #f1f5f9;
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
}

.store-total-price {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
}

.store-savings-tag {
  font-size: 0.75rem;
  color: var(--accent-success);
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.store-stock-status {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
}

.status-all-in-stock {
  background: #d1fae5;
  color: #065f46;
}

.status-missing-items {
  background: #fee2e2;
  color: #991b1b;
}

/* Itemized Matrix Table */
.matrix-card {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
}

.matrix-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.matrix-table th {
  text-align: left;
  padding: 0.75rem 1rem;
  background: #f8fafc;
  color: var(--text-muted);
  font-weight: 700;
  border-bottom: 1px solid var(--border-subtle);
}

.matrix-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #f1f5f9;
}

.matrix-table tr:hover td {
  background: #f8fafc;
}

.best-price-cell {
  background: #ecfdf5 !important;
  color: #047857;
  font-weight: 700;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--text-muted);
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 0.75rem;
}

/* Toast Notification */
.toast-notice {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: #0f172a;
  color: white;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  z-index: 99;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s ease;
}

.toast-notice.show {
  transform: translateY(0);
  opacity: 1;
}
