/*
 * Comptoir du Robinet — Design System v2
 * Visual authority loaded after route-specific structural styles.
 */

:root {
  --cdrt-ds-ink: #132536;
  --cdrt-ds-text: #43515d;
  --cdrt-ds-muted: #74808a;
  --cdrt-ds-navy: #132536;
  --cdrt-ds-navy-hover: #203d55;
  --cdrt-ds-accent: #9a7746;
  --cdrt-ds-bg: #f6f5f1;
  --cdrt-ds-surface: #fff;
  --cdrt-ds-surface-soft: #f1f0ec;
  --cdrt-ds-border: #dde2e4;
  --cdrt-ds-border-strong: #c8d0d4;
  --cdrt-ds-success: #2b6d4a;
  --cdrt-ds-radius-sm: 4px;
  --cdrt-ds-radius-md: 8px;
  --cdrt-ds-radius-lg: 12px;
  --cdrt-ds-shadow-1: 0 1px 2px rgba(19, 37, 54, .04);
  --cdrt-ds-shadow-2: 0 14px 38px rgba(19, 37, 54, .07);
  --cdrt-ds-display: clamp(2.65rem, 5vw, 4.35rem);
  --cdrt-ds-h1: clamp(2.2rem, 4.1vw, 3.55rem);
  --cdrt-ds-h2: clamp(1.7rem, 3vw, 2.55rem);
  --cdrt-ds-h3: clamp(1.1rem, 2vw, 1.35rem);

  /* Existing route CSS now resolves to the same central system. */
  --cdrt-navy-950: var(--cdrt-ds-navy);
  --cdrt-navy-900: #193249;
  --cdrt-navy-800: var(--cdrt-ds-navy-hover);
  --cdrt-ink: var(--cdrt-ds-ink);
  --cdrt-text: var(--cdrt-ds-text);
  --cdrt-muted: var(--cdrt-ds-muted);
  --cdrt-line: var(--cdrt-ds-border);
  --cdrt-line-strong: var(--cdrt-ds-border-strong);
  --cdrt-paper: var(--cdrt-ds-surface);
  --cdrt-soft: var(--cdrt-ds-bg);
  --cdrt-soft-2: var(--cdrt-ds-surface-soft);
  --cdrt-brass: var(--cdrt-ds-accent);
  --cdrt-success: var(--cdrt-ds-success);
  --cdrt-radius-sm: var(--cdrt-ds-radius-sm);
  --cdrt-radius-md: var(--cdrt-ds-radius-md);
  --cdrt-radius-lg: var(--cdrt-ds-radius-lg);
  --cdrt-shadow-sm: var(--cdrt-ds-shadow-1);
  --cdrt-shadow-md: var(--cdrt-ds-shadow-2);
}

body.cdrt-theme {
  color: var(--cdrt-ds-text);
  background: var(--cdrt-ds-surface);
}

body.cdrt-theme h1,
body.cdrt-theme h2,
body.cdrt-theme h3,
body.cdrt-theme h4 {
  color: var(--cdrt-ds-ink);
  font-weight: 720;
  letter-spacing: -.035em;
}

body.cdrt-theme h1 { font-size: var(--cdrt-ds-h1); }
body.cdrt-theme h2 { font-size: var(--cdrt-ds-h2); }
body.cdrt-theme h3 { font-size: var(--cdrt-ds-h3); }

/* Shared buttons and fields ---------------------------------------------- */
body.cdrt-theme :where(
  .cdrt-button,
  .cdrt-header-action,
  .woocommerce a.button,
  .woocommerce button.button,
  .woocommerce input.button,
  .woocommerce #respond input#submit,
  .wp-element-button,
  button[type="submit"]
) {
  min-height: 46px;
  padding: 11px 17px;
  border: 1px solid var(--cdrt-ds-navy);
  border-radius: var(--cdrt-ds-radius-md);
  color: #fff;
  background: var(--cdrt-ds-navy);
  box-shadow: none;
  font-size: 14px;
  font-weight: 720;
  line-height: 1.2;
  text-decoration: none;
  transition: background-color .16s ease, border-color .16s ease, color .16s ease;
}

body.cdrt-theme :where(
  .cdrt-button,
  .cdrt-header-action,
  .woocommerce a.button,
  .woocommerce button.button,
  .woocommerce input.button,
  .woocommerce #respond input#submit,
  .wp-element-button,
  button[type="submit"]
):hover {
  color: #fff;
  background: var(--cdrt-ds-navy-hover);
  border-color: var(--cdrt-ds-navy-hover);
  transform: none;
}

body.cdrt-theme :where(.cdrt-button--secondary, .cdrt-header-action:not(.cdrt-header-action--cart)) {
  color: var(--cdrt-ds-ink);
  background: #fff;
  border-color: var(--cdrt-ds-border-strong);
}

body.cdrt-theme :where(.cdrt-button--secondary, .cdrt-header-action:not(.cdrt-header-action--cart)):hover {
  color: var(--cdrt-ds-ink);
  background: var(--cdrt-ds-bg);
  border-color: var(--cdrt-ds-border-strong);
}

body.cdrt-theme :where(input[type="text"], input[type="email"], input[type="tel"], input[type="password"], input[type="search"], input[type="number"], select, textarea) {
  border: 1px solid var(--cdrt-ds-border-strong);
  border-radius: var(--cdrt-ds-radius-md);
  color: var(--cdrt-ds-ink);
  background: #fff;
  box-shadow: none;
}

body.cdrt-theme :where(input, select, textarea):focus {
  border-color: var(--cdrt-ds-navy-hover);
  box-shadow: 0 0 0 3px rgba(32, 61, 85, .08);
  outline: 0;
}

/* Header ----------------------------------------------------------------- */
body.cdrt-theme .cdrt-trustbar { background: var(--cdrt-ds-navy); }
body.cdrt-theme .cdrt-trustbar__inner { min-height: 34px; }
body.cdrt-theme .cdrt-trustbar__item { font-size: 11px; font-weight: 650; }
body.cdrt-theme .cdrt-site-header { background: #fff; border-bottom-color: var(--cdrt-ds-border); }
body.cdrt-theme .cdrt-header-main { min-height: 80px; }

body.cdrt-theme .cdrt-search__field {
  min-height: 46px;
  border-radius: var(--cdrt-ds-radius-md);
  background: #fbfbfa;
}

body.cdrt-theme .cdrt-search__submit {
  top: 3px;
  right: 3px;
  width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  color: var(--cdrt-ds-ink);
  background: transparent;
  border-color: transparent;
}

body.cdrt-theme .cdrt-search__submit:hover {
  color: var(--cdrt-ds-ink);
  background: var(--cdrt-ds-surface-soft);
  border-color: transparent;
}

body.cdrt-theme .cdrt-nav-wrap { border-top-color: var(--cdrt-ds-border); }
body.cdrt-theme .cdrt-nav-row { min-height: 50px; }
body.cdrt-theme .cdrt-primary-nav a { min-height: 50px; font-size: 13px; font-weight: 680; }
body.cdrt-theme .cdrt-primary-nav .sub-menu {
  border-color: var(--cdrt-ds-border);
  border-radius: 0 0 var(--cdrt-ds-radius-md) var(--cdrt-ds-radius-md);
  box-shadow: var(--cdrt-ds-shadow-2);
}

/* Homepage --------------------------------------------------------------- */
body.cdrt-theme .cdrt-home-hero {
  background: linear-gradient(135deg, #f7f5f0 0%, #f1f0eb 100%);
  border-bottom-color: var(--cdrt-ds-border);
}
body.cdrt-theme .cdrt-home-hero::before { display: none; }
body.cdrt-theme .cdrt-home-hero__inner { min-height: 560px; padding-block: clamp(56px, 7vw, 88px); }
body.cdrt-theme .cdrt-home-hero h1 {
  max-width: 720px;
  font-size: var(--cdrt-ds-display);
  line-height: 1.02;
  letter-spacing: -.05em;
}

body.cdrt-theme :where(.cdrt-home-eyebrow, .cdrt-product-eyebrow, .cdrt-commerce-note__eyebrow, .cdrt-account-note > span) {
  color: var(--cdrt-ds-accent);
  font-size: 11px;
  font-weight: 760;
  letter-spacing: .09em;
}

body.cdrt-theme .cdrt-home-hero__lead { color: var(--cdrt-ds-text); font-size: 1.05rem; line-height: 1.72; }
body.cdrt-theme .cdrt-home-showcase {
  padding: 12px;
  border: 1px solid var(--cdrt-ds-border);
  border-radius: var(--cdrt-ds-radius-lg);
  background: #eae7df;
  box-shadow: var(--cdrt-ds-shadow-2);
}
body.cdrt-theme .cdrt-home-showcase::before { top: 15px; right: 18px; width: 48px; background: var(--cdrt-ds-accent); }
body.cdrt-theme .cdrt-home-showcase__product {
  border: 1px solid rgba(19, 37, 54, .07);
  border-radius: var(--cdrt-ds-radius-md);
  box-shadow: none;
}
body.cdrt-theme .cdrt-home-showcase__product:hover { transform: none; box-shadow: var(--cdrt-ds-shadow-1); }
body.cdrt-theme .cdrt-home-showcase__image,
body.cdrt-theme .cdrt-home-product__image { background: var(--cdrt-ds-bg); }
body.cdrt-theme .cdrt-home-section { padding-block: clamp(64px, 8vw, 96px); }
body.cdrt-theme .cdrt-home-section__header h2 { font-size: var(--cdrt-ds-h2); letter-spacing: -.04em; }

body.cdrt-theme :where(.cdrt-home-category, .cdrt-home-product, .cdrt-home-guidance-card) {
  border-color: var(--cdrt-ds-border);
  border-radius: var(--cdrt-ds-radius-lg);
  box-shadow: none;
}
body.cdrt-theme :where(.cdrt-home-category, .cdrt-home-product):hover {
  border-color: var(--cdrt-ds-border-strong);
  transform: none;
  box-shadow: var(--cdrt-ds-shadow-1);
}
body.cdrt-theme .cdrt-home-category__visual { background: var(--cdrt-ds-bg); }
body.cdrt-theme .cdrt-home-guidance-card { background: rgba(255,255,255,.72); }
body.cdrt-theme .cdrt-home-guidance-card__number { color: var(--cdrt-ds-accent); border-color: rgba(154,119,70,.35); }

/* Catalogue -------------------------------------------------------------- */
body.cdrt-theme.cdrt-catalog .woocommerce-products-header__title.page-title {
  font-size: var(--cdrt-ds-h1);
  letter-spacing: -.045em;
}
body.cdrt-theme .cdrt-catalog-category {
  min-height: 38px;
  border-radius: var(--cdrt-ds-radius-md);
  border-color: var(--cdrt-ds-border);
  font-weight: 650;
}
body.cdrt-theme .cdrt-catalog-category.is-active { border-color: var(--cdrt-ds-navy); background: var(--cdrt-ds-navy); }
body.cdrt-theme.cdrt-catalog .woocommerce ul.products li.product,
body.cdrt-theme.cdrt-catalog .woocommerce-page ul.products li.product {
  border-color: var(--cdrt-ds-border);
  border-radius: var(--cdrt-ds-radius-lg);
  box-shadow: none;
}
body.cdrt-theme.cdrt-catalog .woocommerce ul.products li.product:hover {
  border-color: var(--cdrt-ds-border-strong);
  transform: none;
  box-shadow: var(--cdrt-ds-shadow-1);
}
body.cdrt-theme.cdrt-catalog .woocommerce ul.products li.product a img {
  background: var(--cdrt-ds-bg);
  transition: opacity .16s ease;
}
body.cdrt-theme.cdrt-catalog .woocommerce ul.products li.product:hover a img { transform: none; opacity: .96; }

/* Product ---------------------------------------------------------------- */
body.cdrt-theme.cdrt-product div.product .product_title { font-size: var(--cdrt-ds-h1); letter-spacing: -.045em; }
body.cdrt-theme.cdrt-product .woocommerce-product-gallery__image,
body.cdrt-theme.cdrt-product .woocommerce-product-gallery .flex-control-thumbs img {
  border-color: var(--cdrt-ds-border);
  border-radius: var(--cdrt-ds-radius-md);
  background: var(--cdrt-ds-bg);
}
body.cdrt-theme.cdrt-product .woocommerce-product-gallery__image:first-child { border-radius: var(--cdrt-ds-radius-lg); }
body.cdrt-theme.cdrt-product div.product p.price,
body.cdrt-theme.cdrt-product div.product span.price { color: var(--cdrt-ds-ink); font-weight: 760; }
body.cdrt-theme.cdrt-product div.product .summary { top: 18px; }

/* Cart, checkout, account ------------------------------------------------ */
body.cdrt-theme.cdrt-cart .cdrt-main,
body.cdrt-theme.cdrt-checkout .cdrt-main,
body.cdrt-theme.cdrt-account .cdrt-main { background: var(--cdrt-ds-bg); }

body.cdrt-theme.cdrt-cart .cdrt-entry-header h1,
body.cdrt-theme.cdrt-checkout .cdrt-entry-header h1,
body.cdrt-theme.cdrt-account .cdrt-entry-header h1 { font-size: var(--cdrt-ds-h1); }

body.cdrt-theme.cdrt-cart table.shop_table,
body.cdrt-theme.cdrt-checkout .woocommerce-checkout-review-order,
body.cdrt-theme.cdrt-account .woocommerce-MyAccount-navigation,
body.cdrt-theme.cdrt-account .woocommerce-MyAccount-content {
  border-color: var(--cdrt-ds-border);
  border-radius: var(--cdrt-ds-radius-lg);
  box-shadow: none;
}

body.cdrt-theme.cdrt-cart table.shop_table th,
body.cdrt-theme.cdrt-checkout table.shop_table th { background: #f7f6f3; }

body.cdrt-theme .woocommerce-message,
body.cdrt-theme .woocommerce-info,
body.cdrt-theme .woocommerce-error {
  border-radius: var(--cdrt-ds-radius-md);
  box-shadow: none;
}

/* Editorial -------------------------------------------------------------- */
body.cdrt-theme .cdrt-post-card {
  border-color: var(--cdrt-ds-border);
  border-radius: var(--cdrt-ds-radius-lg);
  box-shadow: none;
}
body.cdrt-theme .cdrt-entry-content :where(blockquote, table, .wp-block-group, .wp-block-columns) {
  border-radius: var(--cdrt-ds-radius-md);
}

/* Footer ----------------------------------------------------------------- */
body.cdrt-theme .cdrt-footer-trust { background: #f1f0ec; }
body.cdrt-theme .cdrt-footer-trust__item { padding-block: 22px; }
body.cdrt-theme .cdrt-site-footer { background: var(--cdrt-ds-navy); }

@media (max-width: 980px) {
  body.cdrt-theme .cdrt-header-main { min-height: 72px; }
  body.cdrt-theme .cdrt-home-hero__inner { min-height: 0; padding-block: 52px 64px; }
  body.cdrt-theme .cdrt-home-showcase { margin-top: 8px; }
}

@media (max-width: 700px) {
  body.cdrt-theme .cdrt-trustbar__inner { min-height: 32px; }
  body.cdrt-theme .cdrt-home-hero h1 { font-size: clamp(2.35rem, 11vw, 3.3rem); }
  body.cdrt-theme .cdrt-home-section { padding-block: 56px; }
  body.cdrt-theme :where(.cdrt-button, .woocommerce a.button, .woocommerce button.button, .woocommerce input.button) { min-height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  body.cdrt-theme *,
  body.cdrt-theme *::before,
  body.cdrt-theme *::after {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}
