/* Maison Étoile brand skin — layered on top of stock Bootstrap 5.3.
   Custom properties here (not Bootstrap's own --bs-* chain) are what the server-side
   Site Settings override in _Layout.cshtml targets, so the dynamic header/button color
   works regardless of how any given Bootstrap version wires its own internals. */

:root {
  --color-ivory: #faf7f2;
  --color-ivory-deep: #f2ecdf;
  --color-beige: #e8dfd0;
  --color-beige-deep: #d9cbb3;
  --color-charcoal: #1c1815;
  --color-charcoal-soft: #322b25;
  --color-blush: #e3c2bd;
  --color-blush-deep: #cf9d97;
  --color-gold: #b6935e;
  --color-gold-soft: #d3b686;
  --color-white: #ffffff;

  --color-header-blue: #2f7ec7;
  --color-header-blue-dark: #1f5a8c;

  --brand-button-color: var(--color-charcoal);
  --brand-button-text-color: var(--color-ivory);

  --brand-radius: 0.3rem;
  --font-display: "Cormorant Garamond", serif;
  --font-sans: "Manrope", sans-serif;
}

html, body {
  height: 100%;
}

body {
  background-color: var(--color-ivory);
  color: var(--color-charcoal);
  font-family: var(--font-sans);
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

main {
  flex: 1 0 auto;
}

h1, h2, h3, h4, h5, .font-display {
  font-family: var(--font-display);
  letter-spacing: 0.01em;
}

.tracking-label {
  letter-spacing: 0.16em;
  font-size: 0.75rem;
  text-transform: uppercase;
}

a {
  color: var(--color-gold);
}
a:hover {
  color: var(--color-gold-soft);
}

.border-brand {
  border-color: var(--color-beige-deep) !important;
}

.bg-ivory {
  background-color: var(--color-ivory);
}
.bg-ivory-deep {
  background-color: var(--color-ivory-deep);
}
.bg-charcoal {
  background-color: var(--color-charcoal);
  color: var(--color-ivory);
}

/* Buttons: driven by the brand tokens above, not Bootstrap's own --bs-primary chain,
   so the Site Settings button-color override in _Layout.cshtml always applies cleanly. */
.btn-brand {
  background-color: var(--brand-button-color);
  border-color: var(--brand-button-color);
  color: var(--brand-button-text-color);
  border-radius: var(--brand-radius);
}
.btn-brand:hover,
.btn-brand:focus {
  filter: brightness(1.1);
  background-color: var(--brand-button-color);
  border-color: var(--brand-button-color);
  color: var(--brand-button-text-color);
}
.btn-outline-brand {
  background-color: transparent;
  border-color: var(--color-charcoal);
  color: var(--color-charcoal);
  border-radius: var(--brand-radius);
}
.btn-outline-brand:hover {
  background-color: var(--color-charcoal);
  color: var(--color-ivory);
}

.card, .form-control, .form-select, .btn {
  border-radius: var(--brand-radius);
}

/* Header — matches the original app: white main bar with charcoal icons, the dynamic
   header color only appears on the thin top promo strip and the bottom nav bar. */
.site-header-sticky {
  position: sticky;
  top: 0;
  z-index: 1030;
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(4px);
}
.site-header-top {
  background-color: var(--color-header-blue-dark);
  color: var(--color-white);
}
.announcement-ticker {
  overflow: hidden;
  white-space: nowrap;
}
.announcement-ticker-track {
  display: inline-flex;
  width: max-content;
  animation: announcement-ticker-scroll 18s linear infinite;
}
.announcement-ticker:hover .announcement-ticker-track {
  animation-play-state: paused;
}
.announcement-ticker-item {
  display: inline-block;
  padding: 0.5rem 3rem;
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
@keyframes announcement-ticker-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
.site-header-main {
  background-color: var(--color-white);
}
.site-header-icon {
  color: var(--color-charcoal);
  text-decoration: none;
}
.site-header-icon:hover {
  color: var(--color-gold);
}
.site-header-cart-badge {
  background-color: var(--color-header-blue) !important;
  color: var(--color-white);
}
.site-header-nav {
  background-color: var(--color-header-blue);
}
.site-header-nav a {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.site-header-nav a:hover {
  color: var(--color-white);
}

.site-footer {
  background-color: var(--color-charcoal);
  color: var(--color-ivory-deep);
}
.site-footer a {
  color: var(--color-ivory-deep);
}
.site-footer a:hover {
  color: var(--color-gold-soft);
}

.price-original {
  text-decoration: line-through;
  color: #6b6058;
}
.price-discount {
  color: var(--color-gold);
  font-weight: 600;
}

.product-card img {
  aspect-ratio: 3 / 4;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.product-card:hover .product-card-image-wrap img {
  transform: scale(1.05);
}

.plp-badge {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  background-color: var(--color-charcoal);
  color: var(--color-ivory);
  font-size: 0.625rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.25rem 0.6rem;
  border-radius: var(--brand-radius);
}
.plp-oos-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.92);
  color: var(--color-charcoal-soft);
  font-size: 0.625rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: center;
  padding: 0.5rem 0;
}
.plp-wishlist-btn {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: none;
  background-color: rgba(255, 255, 255, 0.92);
  color: var(--color-charcoal);
  opacity: 0;
  transition: opacity 0.2s ease, color 0.15s ease;
  cursor: pointer;
  z-index: 2;
}
.product-card:hover .plp-wishlist-btn,
.plp-wishlist-btn:focus-visible {
  opacity: 1;
}
.plp-wishlist-btn:hover {
  color: var(--color-gold);
}
.plp-wishlist-btn[data-added="true"] {
  color: var(--color-gold);
}

/* PLP filter sidebar */
.plp-filter-group {
  border-bottom: 1px solid var(--color-beige-deep);
  padding-bottom: 1.5rem;
  margin-bottom: 1.5rem;
}
.plp-filter-group:last-child {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0;
}
.plp-filter-link {
  display: block;
  color: var(--color-charcoal);
  opacity: 0.8;
  text-decoration: none;
  font-size: 0.875rem;
  transition: color 0.15s ease;
}
.plp-filter-link:hover {
  color: var(--color-gold);
}
.plp-filter-link.active {
  font-weight: 600;
  color: var(--color-gold);
  opacity: 1;
}
.plp-filter-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.plp-filter-check i {
  font-size: 1rem;
}
.plp-subcategory-list {
  border-left: 1px solid var(--color-beige-deep);
}
.plp-color-swatch {
  display: inline-block;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--color-beige-deep);
  cursor: pointer;
}
.plp-color-swatch.selected {
  box-shadow: 0 0 0 2px var(--color-ivory), 0 0 0 4px var(--color-gold);
}

.plp-sort-select {
  width: auto;
  appearance: none;
  padding-right: 2rem;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%231c1815' stroke-width='2'%3e%3cpath d='m4 6 4 4 4-4'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.6rem center;
  background-size: 12px;
}

.plp-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}
.plp-pagination a,
.plp-page-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  height: 2.25rem;
  padding: 0 0.5rem;
  border-radius: var(--brand-radius);
  font-size: 0.875rem;
  color: var(--color-charcoal);
  text-decoration: none;
}
.plp-pagination a:hover {
  background-color: var(--color-ivory-deep);
}
.plp-pagination a.active {
  background-color: var(--color-charcoal);
  color: var(--color-ivory);
}
.plp-pagination a.disabled {
  opacity: 0.4;
  pointer-events: none;
}

.border-transparent {
  border-color: transparent !important;
}
.pdp-thumb {
  cursor: pointer;
}
.pdp-description :is(h1, h2, h3, h4, h5, h6) {
  font-size: 1rem;
  font-weight: 600;
  margin-top: 1rem;
  margin-bottom: 0.5rem;
}
.pdp-description p:last-child,
.pdp-description ul:last-child,
.pdp-description ol:last-child {
  margin-bottom: 0;
}

/* PDP image gallery — swipeable slider on touch devices, arrow buttons on hover/desktop */
.pdp-gallery-viewport {
  position: relative;
  overflow: hidden;
  border-radius: var(--brand-radius);
}
.pdp-gallery-track {
  display: flex;
  touch-action: pan-y;
  transition: transform 0.3s ease;
}
.pdp-gallery-slide {
  flex: 0 0 100%;
  min-width: 0;
}
.pdp-gallery-slide img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  transition: transform 0.2s ease;
  cursor: zoom-in;
}
@media (hover: hover) and (pointer: fine) {
  .pdp-gallery-slide.pdp-gallery-zoomed img {
    transform: scale(2);
  }
}
.pdp-video-poster {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 3 / 4;
  background: #000;
  color: #fff;
  font-size: 3rem;
  cursor: pointer;
}
.pdp-gallery-video-slide video {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
}
.pdp-gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  color: var(--color-charcoal);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
  cursor: pointer;
}
.pdp-gallery-nav:hover {
  color: var(--color-gold);
}
.pdp-gallery-prev {
  left: 10px;
}
.pdp-gallery-next {
  right: 10px;
}

/* PDP variant selector — mirrors the original app's swatch/pill/stepper pattern */
.pdp-color-swatch {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
  border: 2px solid transparent;
  background: none;
  cursor: pointer;
  transition: border-color 0.15s ease;
}
.pdp-color-swatch.selected {
  border-color: var(--color-charcoal);
}
.pdp-color-swatch span {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 1px solid var(--color-beige-deep);
}

.pdp-size-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  min-width: 40px;
  padding: 0 0.75rem;
  font-size: 0.875rem;
  background: var(--color-white);
  color: var(--color-charcoal);
  border: 1px solid var(--color-beige-deep);
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}
.pdp-size-btn:hover:not(.unavailable) {
  border-color: var(--color-charcoal);
}
.pdp-size-btn.selected {
  border-color: var(--color-charcoal);
  background: var(--color-charcoal);
  color: var(--color-ivory);
}
.pdp-size-btn.unavailable {
  color: #a89d90;
  text-decoration: line-through;
  cursor: not-allowed;
}
.pdp-size-btn:disabled {
  pointer-events: none;
}

.pdp-qty-stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--color-beige-deep);
}
.pdp-qty-stepper button {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  font-size: 1rem;
  cursor: pointer;
}
.pdp-qty-stepper button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.pdp-qty-stepper span {
  display: inline-block;
  width: 40px;
  text-align: center;
  font-size: 0.875rem;
}

.admin-sidebar {
  background-color: var(--color-charcoal);
  color: var(--color-ivory-deep);
  min-height: 100vh;
}
.admin-sidebar a {
  color: var(--color-ivory-deep);
  text-decoration: none;
}
.admin-sidebar a.active,
.admin-sidebar a:hover {
  color: var(--color-gold-soft);
}
.admin-sidebar .nav-group-label {
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #a89d90;
}

/* Toast notifications — mirrors the original app's Sonner toasts (bottom-right, compact card) */
.app-toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 1080;
  display: flex;
  flex-direction: column-reverse;
  gap: 0.5rem;
  pointer-events: none;
}
.app-toast {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  min-width: 280px;
  max-width: 356px;
  padding: 0.75rem 0.9rem;
  background: var(--color-white);
  color: var(--color-charcoal);
  border: 1px solid var(--color-beige-deep);
  border-radius: var(--brand-radius);
  box-shadow: 0 4px 14px rgba(28, 24, 21, 0.12);
  font-size: 0.875rem;
  pointer-events: auto;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.app-toast.show {
  opacity: 1;
  transform: translateY(0);
}
.app-toast.hide {
  opacity: 0;
}
.app-toast-icon {
  flex-shrink: 0;
  display: flex;
  margin-top: 0.1rem;
}
.app-toast-success .app-toast-icon { color: #2f7d4f; }
.app-toast-error .app-toast-icon { color: var(--destructive, #b3442c); }
.app-toast-info .app-toast-icon { color: var(--color-header-blue); }
.app-toast-message {
  flex: 1;
  line-height: 1.4;
}
.app-toast-close {
  flex-shrink: 0;
  background: none;
  border: none;
  color: #a89d90;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}
.app-toast-close:hover {
  color: var(--color-charcoal);
}

.validation-summary-valid,
.field-validation-valid {
  display: none;
}
.input-validation-error {
  border-color: var(--destructive, #b3442c) !important;
}

/* Global loading UX — top progress bar on page navigation, spinner
   injected into submit buttons while a request is in flight. */
#page-loader-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  background: linear-gradient(90deg, var(--color-gold), var(--color-gold-soft));
  box-shadow: 0 0 8px var(--color-gold);
  z-index: 1100;
  opacity: 0;
  pointer-events: none;
}
.btn-spinner-icon {
  margin-right: 0.45rem;
  vertical-align: -0.125em;
}

/* Admin: rich text editor (product description) */
.rte-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 4px;
  border: 1px solid var(--color-beige-deep);
  border-bottom: none;
  border-radius: var(--brand-radius) var(--brand-radius) 0 0;
  background: var(--color-ivory-deep);
}
.rte-btn {
  min-width: 30px;
  height: 30px;
  padding: 0 6px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: none;
  color: var(--color-charcoal);
  cursor: pointer;
  font-size: 0.85rem;
}
.rte-btn:hover {
  background: var(--color-white);
  border-color: var(--color-beige-deep);
}
.rte-sep {
  width: 1px;
  margin: 4px 2px;
  background: var(--color-beige-deep);
}
.rte-editable {
  min-height: 180px;
  border-radius: 0 0 var(--brand-radius) var(--brand-radius);
  overflow-y: auto;
  padding: 0.6rem 0.75rem;
}
.rte-editable:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--color-gold-soft);
}
.rte-editable p:last-child {
  margin-bottom: 0;
}

/* Admin: homepage hero style picker */
.hero-style-card {
  cursor: pointer;
  display: block;
  border: 2px solid var(--color-beige-deep);
  border-radius: var(--brand-radius);
  overflow: hidden;
  background: var(--color-white);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.hero-style-card:hover {
  border-color: var(--color-gold-soft);
}
.hero-style-card:has(.hero-style-radio:checked) {
  border-color: var(--color-gold);
  box-shadow: 0 0 0 2px var(--color-gold);
}
.hero-style-preview {
  height: 120px;
  display: flex;
  flex-direction: column;
}
.hero-style-mock-slider,
.hero-style-mock-photo {
  flex: 1;
  background: linear-gradient(135deg, var(--color-charcoal), var(--color-charcoal-soft));
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.hero-style-mock-text {
  width: 60%;
  height: 8px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 2px;
}
.hero-style-mock-search {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 4px;
  background: var(--color-white);
  padding: 4px;
  border-radius: 3px;
}
.hero-style-mock-search span {
  display: block;
  width: 20px;
  height: 8px;
  background: var(--color-beige-deep);
  border-radius: 2px;
}
.hero-style-mock-pills {
  display: flex;
  gap: 4px;
  justify-content: center;
  align-items: center;
  padding: 6px;
  background: var(--color-ivory-deep);
}
.hero-style-mock-pills span {
  display: block;
  width: 24px;
  height: 8px;
  background: var(--color-beige-deep);
  border-radius: 8px;
}
.hero-style-mock-tiles {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  background: var(--color-ivory-deep);
  overflow: hidden;
}
.hero-style-mock-tiles span {
  flex: 0 0 auto;
  width: 20px;
  height: 26px;
  background: var(--color-beige-deep);
  border-radius: 2px;
}

/* Homepage: swipeable subcategory tile row (SliderWithSubcategoryGrid hero style) */
.home-subcat-section {
  position: relative;
}
.home-subcat-scroller {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scroll-behavior: smooth;
  padding: 0.25rem 0.25rem 0.75rem;
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.home-subcat-scroller::-webkit-scrollbar {
  display: none;
}
.home-subcat-item {
  flex: 0 0 calc((100% - 5 * 1rem) / 6);
  scroll-snap-align: start;
  text-decoration: none;
  color: inherit;
}
@media (max-width: 991.98px) {
  .home-subcat-item {
    flex-basis: calc((100% - 3 * 1rem) / 4);
  }
}
@media (max-width: 575.98px) {
  .home-subcat-item {
    flex-basis: calc((100% - 1rem) / 2.3);
  }
}
.home-subcat-thumb {
  overflow: hidden;
  background: var(--color-ivory-deep);
  border-radius: var(--brand-radius);
  aspect-ratio: 1 / 1;
}
.home-subcat-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.home-subcat-label {
  display: block;
  text-align: center;
  margin-top: 0.5rem;
  font-size: 0.85rem;
}
.home-subcat-nav {
  position: absolute;
  top: 40%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: var(--color-white);
  color: var(--color-charcoal);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.18);
  cursor: pointer;
  z-index: 2;
}
.home-subcat-nav:hover {
  color: var(--color-gold);
}
.home-subcat-nav:disabled {
  opacity: 0.35;
  cursor: default;
}
.home-subcat-prev {
  left: -14px;
}
.home-subcat-next {
  right: -14px;
}

/* Admin: flash sale style picker */
.hero-style-mock-grid {
  flex: 1;
  background: var(--color-ivory-deep);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 10px;
  align-content: center;
}
.hero-style-mock-grid span {
  display: block;
  aspect-ratio: 3 / 4;
  background: var(--color-beige-deep);
  border-radius: 2px;
}
.hero-style-mock-banner {
  flex: 1;
  background: linear-gradient(135deg, var(--color-gold), var(--color-charcoal));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.hero-style-mock-banner-cta {
  width: 40%;
  height: 14px;
  background: var(--color-white);
  border-radius: 8px;
}
.hero-style-mock-countdown {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.hero-style-mock-countdown-bar {
  background: var(--color-charcoal);
  display: flex;
  gap: 4px;
  align-items: center;
  justify-content: center;
  padding: 8px;
}
.hero-style-mock-countdown-bar span {
  display: block;
  width: 16px;
  height: 14px;
  background: var(--color-gold-soft);
  border-radius: 2px;
}
.hero-style-mock-countdown-grid {
  flex: 1;
  background: var(--color-ivory-deep);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 8px;
}
.hero-style-mock-countdown-grid span {
  display: block;
  aspect-ratio: 3 / 4;
  background: var(--color-beige-deep);
  border-radius: 2px;
}
