/* Reusable UI Components for Sarte */

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 28px;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
}

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

.btn-primary:hover {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

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

.btn-secondary:hover {
  border-color: var(--text-primary);
  background-color: rgba(0, 0, 0, 0.02);
  transform: translateY(-2px);
}

[data-theme="dark"] .btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.02);
}

.btn-accent {
  background-color: var(--accent-gold);
  color: #fff;
  border: 1px solid var(--accent-gold);
}

.btn-accent:hover {
  background-color: var(--accent-gold-hover);
  border-color: var(--accent-gold-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  transition: all var(--transition-fast);
}

.btn-icon:hover {
  border-color: var(--text-primary);
  background-color: var(--bg-secondary);
  transform: scale(1.05);
}

/* Glassmorphism utility */
.glass {
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-glass);
}

/* Badges */
.badge {
  display: inline-block;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: var(--radius-full);
  background-color: var(--accent-sage-light);
  color: var(--accent-sage);
}

.badge-gold {
  background-color: #FAF4EB;
  color: var(--accent-gold);
}
[data-theme="dark"] .badge-gold {
  background-color: #221C14;
}

/* Product Cards */
.product-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-md);
  overflow: hidden;
  background-color: var(--bg-secondary);
  transition: transform var(--transition-smooth), box-shadow var(--transition-smooth);
  border: 1px solid var(--border-color);
}

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

.product-card-img-container {
  position: relative;
  width: 100%;
  padding-top: 75%; /* 4:3 Aspect Ratio */
  overflow: hidden;
  background-color: var(--bg-tertiary);
}

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

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

.product-card-img-count {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 3;
  background: rgba(20, 20, 22, 0.72);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  letter-spacing: 0.04em;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  pointer-events: none;
}

.card-arrow-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 5;
  opacity: 0;
  transition: all var(--transition-fast);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.product-card:hover .card-arrow-btn {
  opacity: 1;
}

.card-arrow-btn:hover {
  background: var(--text-primary);
  color: var(--bg-primary);
  transform: translateY(-50%) scale(1.12);
}

.card-arrow-btn.prev {
  left: 12px;
}

.card-arrow-btn.next {
  right: 12px;
}

.card-dots-bar {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 5;
  padding: 4px 10px;
  border-radius: 12px;
  background: rgba(20, 20, 22, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.card-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.card-dot:hover {
  background: rgba(255, 255, 255, 0.8);
}

.card-dot.active {
  background: #ffffff;
  width: 16px;
  border-radius: 4px;
}

.product-card-badge {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 2;
}

.product-card-favorite {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  background-color: var(--bg-glass);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border-color);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  opacity: 0;
  transform: translateY(-5px);
  transition: all var(--transition-fast);
}

.product-card:hover .product-card-favorite {
  opacity: 1;
  transform: translateY(0);
}

.product-card-favorite:hover {
  background-color: var(--text-primary);
  color: var(--bg-primary);
}

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

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

.product-card-title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.product-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

.product-card-price {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text-primary);
}

.product-card-view-btn {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-gold);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color var(--transition-fast);
}

.product-card-view-btn:hover {
  color: var(--text-primary);
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-smooth);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-container {
  width: 90%;
  max-width: 900px;
  max-height: 90vh;
  border-radius: var(--radius-md);
  overflow-y: auto;
  position: relative;
  transform: translateY(30px);
  transition: transform var(--transition-smooth);
  box-shadow: var(--shadow-lg);
}

.modal-overlay.active .modal-container {
  transform: translateY(0);
}

.modal-close {
  position: absolute;
  top: 24px;
  right: 24px;
  z-index: 10;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.modal-close:hover {
  transform: rotate(90deg);
  background-color: var(--text-primary);
  color: var(--bg-primary);
}

/* Custom Swatches */
.swatch-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}

.color-swatch {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  border: 2px solid transparent;
  background: transparent;
  padding: 2px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.color-swatch-inner {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: var(--radius-full);
  background-size: cover;
  background-position: center;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.color-swatch:hover {
  transform: scale(1.1);
}

.color-swatch.active {
  border-color: var(--accent-gold);
}

.text-swatch {
  padding: 8px 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  background-color: var(--bg-secondary);
  color: var(--text-primary);
}

.text-swatch:hover {
  border-color: var(--text-primary);
}

.text-swatch.active {
  background-color: var(--text-primary);
  color: var(--bg-primary);
  border-color: var(--text-primary);
}

/* Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Responsive Components */
@media (max-width: 768px) {
  .products-grid {
    grid-template-columns: 1fr;
    gap: 24px;
    max-width: 440px;
    margin: 0 auto;
  }
  .card-arrow-btn {
    opacity: 0.9 !important;
    width: 32px;
    height: 32px;
  }
  .card-arrow-btn.prev {
    left: 8px;
  }
  .card-arrow-btn.next {
    right: 8px;
  }
  .card-dots-bar {
    bottom: 10px;
    padding: 3px 8px;
  }
  .card-dot {
    width: 7px;
    height: 7px;
  }
  .card-dot.active {
    width: 16px;
  }
  .modal-container {
    width: 95% !important;
    max-width: 95% !important;
    max-height: 92vh !important;
    border-radius: var(--radius-sm);
  }
  .modal-close {
    top: 14px;
    right: 14px;
    width: 32px;
    height: 32px;
  }
}
