/* ==========================================================================
   Dars Idara — Common styles (design tokens, base reset, shared helpers)
   Load order: common.css -> <component>.css
   ========================================================================== */

:root {
  /* Brand colours */
  --di-green: #123524;
  --di-green-dark: #0d2619;
  --di-green-light: #1c4a33;
  --di-gold: #b98f4f;
  --di-gold-dark: #a17a3f;
  --di-cream: #faf6ef;
  --di-cream-2: #f3ece1;

  /* Neutrals */
  --di-text: #1f2421;
  --di-text-muted: #6b7280;
  --di-border: #e7e1d6;
  --di-white: #ffffff;

  /* Typography */
  --di-font: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --di-fs-xs: 0.75rem;   /* 12px */
  --di-fs-sm: 0.8125rem; /* 13px */
  --di-fs-base: 0.9375rem; /* 15px */
  --di-fs-md: 1rem;

  /* Layout */
  --di-container: 1400px;
  --di-gutter: 16px;

  /* Shape & motion */
  --di-radius-sm: 6px;
  --di-radius: 10px;
  --di-radius-pill: 999px;
  --di-shadow-sm: 0 1px 2px rgba(18, 53, 36, .06);
  --di-shadow: 0 6px 20px rgba(18, 53, 36, .08);
  --di-transition: .22s ease;
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */

/* Padding and borders count inside a declared width. Every `width: 100%` box
   in this design (containers, inputs, dropdowns) assumes this — without it
   each one grows past its parent by its own padding and the page scrolls
   sideways. */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--di-font);
  font-size: var(--di-fs-base);
  font-weight: 400;
  line-height: 1.6;
  color: var(--di-text);
  background-color: var(--di-white);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img,
svg {
  max-width: 100%;
  height: auto;
  vertical-align: middle;
}

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

a:hover { color: var(--di-gold); }

button { font-family: inherit; }

ul.di-plain-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Visible, brand-coloured focus ring for keyboard users (a11y / Lighthouse) */
:focus-visible {
  outline: 2px solid var(--di-gold);
  outline-offset: 2px;
  border-radius: var(--di-radius-sm);
}

/* --------------------------------------------------------------------------
   Layout helpers
   -------------------------------------------------------------------------- */

.di-container {
  width: 100%;
  max-width: var(--di-container);
  margin-inline: auto;
  padding-inline: var(--di-gutter);
}

/* Screen-reader only text (kept local so pages can skip Bootstrap if needed) */
.di-sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Skip link — first focusable element on every page */
.di-skip-link {
  /* Parked above the viewport rather than off to the left, so it can never
     widen the document on small screens. */
  position: fixed;
  left: 0;
  top: -80px;
  z-index: 1080;
  padding: 10px 18px;
  background: var(--di-green);
  color: var(--di-white);
  font-size: var(--di-fs-sm);
  font-weight: 500;
  border-radius: 0 0 var(--di-radius-sm) 0;
}

.di-skip-link:focus {
  top: 0;
  color: var(--di-white);
}

/* --------------------------------------------------------------------------
   Shared components
   -------------------------------------------------------------------------- */

.di-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border: 1px solid transparent;
  border-radius: var(--di-radius-sm);
  font-size: var(--di-fs-base);
  font-weight: 500;
  line-height: 1.2;
  cursor: pointer;
  transition: background-color var(--di-transition), color var(--di-transition),
              border-color var(--di-transition);
}

.di-btn--primary {
  background-color: var(--di-green);
  color: var(--di-white);
}

.di-btn--primary:hover {
  background-color: var(--di-green-light);
  color: var(--di-white);
}

.di-btn--gold {
  background-color: var(--di-gold);
  color: var(--di-white);
}

.di-btn--gold:hover {
  background-color: var(--di-gold-dark);
  color: var(--di-white);
}

.di-btn--outline {
  background-color: transparent;
  border-color: var(--di-border);
  color: var(--di-text);
}

.di-btn--outline:hover {
  border-color: var(--di-green);
  color: var(--di-green);
}

/* Count bubble used by cart / wishlist and later by filters */
.di-badge {
  position: absolute;
  top: -6px;
  right: -8px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--di-radius-pill);
  background-color: var(--di-gold);
  color: var(--di-white);
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
}

/* Section shell — every home-page block uses this rhythm */
.di-section {
  padding-block: 54px;
}

.di-section--tight { padding-block: 34px; }

.di-section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 26px;
}

.di-section__title {
  margin: 0;
  font-size: clamp(1.25rem, 1.05rem + .9vw, 1.75rem);
  font-weight: 600;
  line-height: 1.25;
  color: var(--di-text);
}

.di-section__link {
  flex: none;
  font-size: var(--di-fs-sm);
  font-weight: 500;
  color: var(--di-text-muted);
}

.di-section__link:hover { color: var(--di-gold); }

/* Centred heading with the rule on both sides (Shop By Category) */
.di-section__head--center {
  flex-direction: column;
  justify-content: center;
  gap: 0;
  margin-bottom: 30px;
}

.di-section__title--ruled {
  display: flex;
  align-items: center;
  gap: 18px;
  text-align: center;
}

.di-section__title--ruled::before,
.di-section__title--ruled::after {
  content: "";
  width: clamp(24px, 6vw, 60px);
  height: 1px;
  background-color: var(--di-gold);
  opacity: .6;
}

/* Breadcrumb — shared by every inner page */
.di-breadcrumb {
  padding-block: 16px;
  border-bottom: 1px solid var(--di-border);
  background-color: var(--di-white);
}

.di-breadcrumb__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: var(--di-fs-sm);
  color: var(--di-text-muted);
}

.di-breadcrumb__list li {
  display: flex;
  align-items: center;
  gap: 8px;
}

.di-breadcrumb__list li + li::before {
  content: "›";
  color: #b5bcb6;
}

.di-breadcrumb__list a { color: var(--di-text-muted); }
.di-breadcrumb__list a:hover { color: var(--di-green); }

.di-breadcrumb__list [aria-current="page"] { color: var(--di-gold); }

/* Icons rendered as <img> keep their intrinsic box (avoids layout shift/CLS) */
.di-icon {
  display: block;
  flex: none;
}

/* --------------------------------------------------------------------------
   Motion preferences
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}


/* --------------------------------------------------------------------------
   Flash messages and validation summaries
   Used by the account, checkout, tracking and sign-in screens, so it lives
   here rather than in any one component's stylesheet.
   -------------------------------------------------------------------------- */

.di-note {
  margin: 0 0 18px;
  padding: 12px 16px;
  border: 1px solid var(--di-border);
  border-left-width: 3px;
  border-radius: var(--di-radius-sm);
  background-color: var(--di-cream);
  font-size: var(--di-fs-sm);
  list-style: none;
}

.di-note li + li { margin-top: 4px; }
.di-note.is-success { border-left-color: var(--di-green); }
.di-note.is-error { border-left-color: #b3261e; color: #8c1d18; }
