/* ── Rivailo — Main Stylesheet ─────────────────────────────────── */

/* ── Base ──────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body { font-family: 'DM Sans', sans-serif; background: #faf9f7; color: #0f0e0d; }

/* ── Typography ────────────────────────────────────────────────── */
.font-display { font-family: 'Playfair Display', Georgia, serif; }

h1, h2, h3 { font-family: 'Playfair Display', Georgia, serif; }

/* ── Product Card ──────────────────────────────────────────────── */
.product-card {
  background: #fff;
  border-radius: 1rem;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
}
.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.10);
}
.product-card .card-img-wrap {
  position: relative;
  overflow: hidden;
  aspect-ratio: 3/4;
  background: #f3f3f1;
}
.product-card .card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.product-card:hover .card-img-wrap img {
  transform: scale(1.06);
}
.product-card .card-actions {
  position: absolute;
  bottom: 0;
  left: 0; right: 0;
  padding: 0.75rem;
  background: linear-gradient(to top, rgba(0,0,0,0.5) 0%, transparent 100%);
  display: flex;
  gap: 0.5rem;
  transform: translateY(100%);
  transition: transform 0.3s ease;
}
.product-card:hover .card-actions {
  transform: translateY(0);
}
.product-card .badge-discount {
  position: absolute;
  top: 0.75rem; left: 0.75rem;
  background: #e65c24;
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  padding: 0.2rem 0.5rem;
  border-radius: 0.35rem;
  letter-spacing: 0.03em;
}
.product-card .badge-new {
  position: absolute;
  top: 0.75rem; right: 0.75rem;
  background: #0f0e0d;
  color: white;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 0.35rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ── Swiper Overrides ──────────────────────────────────────────── */
.swiper-button-next,
.swiper-button-prev {
  width: 40px !important;
  height: 40px !important;
  background: white;
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  color: #0f0e0d !important;
}
.swiper-button-next::after,
.swiper-button-prev::after {
  font-size: 14px !important;
  font-weight: 700;
}
.swiper-pagination-bullet-active { background: #e65c24 !important; }

/* ── Variation Buttons ─────────────────────────────────────────── */
.variation-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.375rem 0.875rem;
  border: 1.5px solid #e5e7eb;
  border-radius: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  background: white;
  color: #374151;
  user-select: none;
}
.variation-btn:hover {
  border-color: #e65c24;
  color: #e65c24;
}
.variation-btn.selected {
  border-color: #e65c24;
  background: #e65c24;
  color: white;
}
.variation-btn.disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}
.color-swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid #e5e7eb;
  cursor: pointer;
  padding: 0px!important;
  transition: all 0.15s;
  position: relative;
}
.color-swatch:hover,
.color-swatch.selected {
  border-color: #e65c24;
  transform: scale(1.15);
}
.color-swatch.selected::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 2px solid #e65c24;
}

/* ── Qty Input ─────────────────────────────────────────────────── */
.qty-input-wrap {
  display: inline-flex;
  align-items: center;
  border: 1.5px solid #e5e7eb;
  border-radius: 0.625rem;
  overflow: hidden;
  background: white;
}
.qty-btn {
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  color: #6b7280;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  border: none; background: transparent;
  user-select: none;
}
.qty-btn:hover { background: #f3f3f1; color: #0f0e0d; }
.qty-number {
  width: 44px;
  text-align: center;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
  border: none;
  outline: none;
  background: transparent;
}

/* ── Breadcrumb ────────────────────────────────────────────────── */
.breadcrumb { display: flex; align-items: center; gap: 0.5rem; font-size: 0.8125rem; color: #9ca3af; }
.breadcrumb a { color: #6b7280; text-decoration: none; transition: color 0.15s; }
.breadcrumb a:hover { color: #e65c24; }
.breadcrumb .sep { color: #d1d5db; }

/* ── Star Rating ───────────────────────────────────────────────── */
.star-rating { color: #f59e0b; font-size: 0.8rem; letter-spacing: 0.05em; }

/* ── Section Title ─────────────────────────────────────────────── */
.section-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  line-height: 1.2;
  color: #0f0e0d;
}
.section-subtitle {
  font-size: 0.875rem;
  color: #9ca3af;
  margin-top: 0.375rem;
}

/* ── Buttons ───────────────────────────────────────────────────── */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  background: #e65c24; color: white;
  border: none; border-radius: 0.75rem;
  font-size: 0.875rem; font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  text-decoration: none;
}
.btn-primary:hover { background: #d44519; box-shadow: 0 6px 20px rgba(230,92,36,0.35); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  background: white; color: #0f0e0d;
  border: 1.5px solid #e5e7eb; border-radius: 0.75rem;
  font-size: 0.875rem; font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  text-decoration: none;
}
.btn-secondary:hover { border-color: #0f0e0d; background: #faf9f7; }

.btn-dark {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  background: #0f0e0d; color: white;
  border: none; border-radius: 0.75rem;
  font-size: 0.875rem; font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  text-decoration: none;
}
.btn-dark:hover { background: #2d2c2b; }

/* ── Cart Sidebar Items ────────────────────────────────────────── */
.cart-sidebar-item {
  display: flex; gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid #f3f4f6;
}
.cart-sidebar-item:last-child { border-bottom: none; }
.cart-sidebar-item img { width: 64px; height: 80px; object-fit: cover; border-radius: 0.5rem; flex-shrink: 0; }

/* ── Skeleton Loader ───────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, #f0f0ee 25%, #e6e6e4 50%, #f0f0ee 75%);
  background-size: 200% 100%;
  animation: skeleton-wave 1.5s infinite;
  border-radius: 0.5rem;
}
@keyframes skeleton-wave {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Sticky Product Actions (mobile) ──────────────────────────── */
.sticky-buy-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: white;
  border-top: 1px solid #e5e7eb;
  padding: 0.75rem 1rem;
  display: flex; gap: 0.5rem;
  z-index: 30;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
}

/* ── Animations ────────────────────────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-in-up { animation: fadeInUp 0.4s ease both; }
.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }

/* ── Form Styles ───────────────────────────────────────────────── */
.form-input {
  width: 100%;
  padding: 0.625rem 0.875rem;
  background: white;
  border: 1.5px solid #e5e7eb;
  border-radius: 0.625rem;
  font-size: 0.875rem;
  font-family: 'DM Sans', sans-serif;
  color: #0f0e0d;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}
.form-input:focus {
  border-color: #e65c24;
  box-shadow: 0 0 0 3px rgba(230,92,36,0.12);
}
.form-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #374151;
  margin-bottom: 0.375rem;
}
.form-error { font-size: 0.75rem; color: #ef4444; margin-top: 0.25rem; }

/* ── Checkout Steps ────────────────────────────────────────────── */
.step-indicator {
  display: flex; align-items: center; gap: 0;
}
.step-dot {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 700;
  flex-shrink: 0;
  transition: background 0.2s, color 0.2s;
}
.step-dot.active { background: #e65c24; color: white; }
.step-dot.done { background: #0f0e0d; color: white; }
.step-dot.pending { background: #e5e7eb; color: #9ca3af; }
.step-line { flex: 1; height: 2px; background: #e5e7eb; }
.step-line.done { background: #0f0e0d; }

/* ── Scrollbar ─────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #faf9f7; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #9ca3af; }

/* ── Responsive ────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .sticky-buy-bar { display: flex; }
}
@media (min-width: 641px) {
  .sticky-buy-bar { display: none !important; }
}

/* Out-of-stock variation buttons */
.out-of-stock-btn {
  opacity: 0.38 !important;
  cursor: not-allowed !important;
  position: relative;
  text-decoration: line-through;
}
.out-of-stock-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    135deg,
    transparent,
    transparent 4px,
    rgba(0,0,0,.12) 4px,
    rgba(0,0,0,.12) 5px
  );
  border-radius: inherit;
  pointer-events: none;
}
@keyframes pulse {
  0%,100%{opacity:1} 50%{opacity:.4}
}

/* ── Bookmark Button ─────────────────────────────────────────────*/
.btn-bookmark {
  position: absolute;
  top: 0.6rem; right: 0.6rem;
  z-index: 10;
  width: 30px; height: 30px;
  background: rgba(255,255,255,0.92);
  border: none;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  box-shadow: 0 1px 5px rgba(0,0,0,0.15);
  transition: background 0.15s, transform 0.15s;
  font-size: 12px;
  color: #9ca3af;
}
.btn-bookmark:hover {
  background: #fff5f0;
  transform: scale(1.1);
  color: #e65c24;
}
.btn-bookmark.bookmarked {
  background: #fff5f0;
  color: #e65c24;
}
.btn-bookmark.bookmarked i {
  color: #e65c24;
}
/* Bookmark count badge in nav */
.bookmark-count-badge {
  position: absolute;
  top: -4px; right: -4px;
  background: #e65c24;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  width: 16px; height: 16px;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  line-height: 16px;
  text-align: center;
}
