/*
   Reusable pieces of the storefront, after the WiAutomation reference
   (docs/wiautomation-reference/). Pages compose these; pages.css holds only what a
   component cannot.
*/

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  min-height: var(--control-h); padding: 0 var(--sp-5);
  border: 1px solid transparent; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600; line-height: 1; white-space: nowrap;
  text-decoration: none; cursor: pointer;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.btn:hover { text-decoration: none; }
.btn[disabled], .btn.is-disabled { opacity: .5; cursor: not-allowed; }
.btn--teal { background: var(--c-teal); color: var(--c-white); }
.btn--teal:hover { background: var(--c-teal-dark); color: var(--c-white); }
.btn--orange { background: var(--c-orange); color: var(--c-white); }
.btn--orange:hover { background: var(--c-orange-dark); color: var(--c-white); }
.btn--grey { background: var(--c-bg-alt); color: var(--c-text); }
.btn--grey:hover { background: var(--c-border); color: var(--c-text); }
.btn--line { background: var(--c-white); border-color: var(--c-border-strong); color: var(--c-text); }
.btn--line:hover { border-color: var(--c-teal); color: var(--c-teal); }
.btn--text { min-height: 0; padding: 0; background: none; color: var(--c-teal); font-weight: 500; }
.btn--text:hover { color: var(--c-teal-dark); }
.btn--lg { min-height: var(--btn-h-lg); font-size: var(--fs-base); }
.btn--block { width: 100%; }
.btn.is-busy { position: relative; color: transparent; pointer-events: none; }
.btn.is-busy::after {
  content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .5); border-top-color: var(--c-white);
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* A teal link ending in a chevron: "Contact us ›", "Our brands ›" */
.link-more { color: var(--c-teal); font-weight: 600; }
.link-more::after { content: " \203A"; }

/* ===== Form fields =====
   A field's label sits inside the input as its placeholder and moves up onto the border
   once the field has focus or a value; selects keep it up. Markup:
   <div class="field"><input placeholder=" " …><label …>Email</label><span asp-validation-for></span></div> */
.field { position: relative; display: flex; flex-direction: column; }
.field__control,
.field input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.field select,
.field textarea {
  width: 100%; min-height: var(--control-h); padding: 10px 12px 8px;
  background: var(--c-white); border: 1px solid var(--c-border); border-radius: var(--radius-sm);
  font-size: 13px; color: var(--c-text);
  transition: border-color var(--t-fast) var(--ease);
}
.field textarea { min-height: 84px; resize: vertical; line-height: 1.5; }
.field select { appearance: none; padding-right: 32px; font-weight: 600; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%2331c7c7' stroke-width='1.6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; }
.field input::placeholder, .field textarea::placeholder { color: transparent; }
.field :is(input, select, textarea):focus { outline: none; border-color: var(--c-teal); }
.field > label {
  position: absolute; left: 12px; top: 11px; padding: 0 4px; margin-left: -4px;
  font-size: 13px; color: var(--c-text-faint); background: var(--c-white);
  pointer-events: none; transition: all var(--t-fast) var(--ease);
}
.field :is(input, textarea):focus ~ label,
.field :is(input, textarea):not(:placeholder-shown) ~ label,
.field select ~ label,
.field.is-filled > label {
  top: -7px; font-size: var(--fs-xs); color: var(--c-text-muted);
}
.field :is(input, textarea, select):focus ~ label { color: var(--c-teal); }
.field--icon input { padding-left: 38px !important; }
.field--icon > label { left: 38px; }
.field--icon > .i { position: absolute; left: 12px; top: 10px; color: var(--c-text-faint); }
.field--error :is(input, select, textarea) { border-color: var(--c-error); }
.field-validation-error { display: block; margin-top: 4px; font-size: var(--fs-sm); color: #d8463a; }
.field-validation-valid { display: none; }
.field-hint { margin-top: 6px; font-size: var(--fs-xs); color: var(--c-text-muted); }
.form-grid { display: grid; gap: 14px; }
.form-grid--2 { grid-template-columns: 1fr 1fr; }
.form-grid--code { grid-template-columns: 1fr 1fr 44px; }
.form-grid > .span-2 { grid-column: 1 / -1; }
.form-errors { margin-bottom: var(--sp-4); padding: var(--sp-3); background: var(--c-red-soft); color: #b3392f; font-size: 13px; border-radius: var(--radius-sm); }
.form-errors ul { margin: 0; padding-left: var(--sp-4); }

/* Toggle switch: "Stay connected", "I accept the Privacy Policy" */
.toggle { display: inline-flex; align-items: center; gap: var(--sp-3); font-size: 13px; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle__track {
  position: relative; flex: none; width: 40px; height: 20px; border-radius: 2px;
  background: var(--c-border); transition: background var(--t-fast) var(--ease);
}
.toggle__track::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px;
  background: var(--c-white); border-radius: 1px; box-shadow: 0 1px 2px rgba(0, 0, 0, .2);
  transition: transform var(--t-fast) var(--ease);
}
.toggle input:checked + .toggle__track { background: var(--c-teal); }
.toggle input:checked + .toggle__track::after { transform: translateX(20px); }
.toggle input:focus-visible + .toggle__track { outline: 2px solid var(--c-teal); outline-offset: 2px; }

/* Checkbox and radio: square teal tick */
.check { display: inline-flex; align-items: flex-start; gap: var(--sp-2); font-size: 13px; cursor: pointer; }
.check input { accent-color: var(--c-teal); width: 15px; height: 15px; margin: 2px 0 0; flex: none; }

/* Quantity stepper: −  1  + */
.qty { display: inline-flex; align-items: center; gap: var(--sp-2); }
.qty button { width: 28px; height: 28px; border: 0; background: none; font-size: 20px; line-height: 1; color: var(--c-text); }
.qty button:hover { color: var(--c-teal); }
.qty input { width: 40px; height: 28px; border: 0; text-align: center; font-weight: 700; font-size: var(--fs-base); -moz-appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* Dashed upload box: "Upload attachments" */
.upload-box { display: block; padding: 12px; border: 1px dashed var(--c-border-strong); text-align: center; font-size: var(--fs-sm); font-weight: 600; color: var(--c-teal); cursor: pointer; }
.upload-box input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.upload-box__names { display: block; margin-top: 4px; color: var(--c-text-muted); font-weight: 400; }

/* ===== Cards and boxes ===== */
.card { background: var(--c-white); border-radius: var(--radius); box-shadow: var(--shadow-card); }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); padding: var(--sp-4) var(--sp-4) 14px; margin: 0 var(--sp-4); padding-inline: 0; border-bottom: 1px solid var(--c-border); }
.card__title { font-size: var(--fs-md); font-weight: 700; }
.card__body { padding: var(--sp-4); }
.box { border: 1px solid var(--c-border); border-radius: var(--radius); background: var(--c-white); }

/* Section label: "News", "Offers", "Our brands ›" */
.section-label { margin: 0 0 var(--sp-4); font-size: var(--fs-md); font-weight: 700; }
.section-label a { color: var(--c-teal); }

/* ===== Product card ===== */
.p-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 30px 18px; }
.p-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.p-card { display: flex; flex-direction: column; color: var(--c-text); text-decoration: none; }
.p-card:hover { color: var(--c-text); }
.p-card__img {
  display: flex; align-items: center; justify-content: center; aspect-ratio: 184 / 133; overflow: hidden;
  margin-bottom: 18px; padding: 10px; background: var(--c-white);
  border: 1px solid var(--c-border); border-radius: var(--radius);
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.p-card:hover .p-card__img { border-color: var(--c-teal); box-shadow: var(--shadow-card); }
.p-card__img img { width: 100%; height: 100%; object-fit: contain; }
.p-card__img .i { width: 40px; height: 40px; color: var(--c-border-strong); }
.p-card__brand { font-size: var(--fs-xs); color: var(--c-text-muted); margin-bottom: 2px; }
.p-card__name {
  font-size: 13px; font-weight: 500; line-height: 1.3; text-transform: uppercase;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.p-card__price { margin-top: 2px; font-size: 13px; font-weight: 700; color: var(--c-teal); }

/* ===== Bordered link table: home brands/categories, all brands ===== */
.link-table { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--c-border); border-radius: var(--radius); background: var(--c-white); overflow: hidden; }
.link-table > * { display: flex; align-items: center; gap: 14px; min-height: 49px; padding: 8px 22px; border-bottom: 1px solid var(--c-border); color: var(--c-text); font-size: 13px; }
.link-table > *:nth-child(odd) { border-right: 1px solid var(--c-border); }
.link-table > a:hover { color: var(--c-teal); background: #fbfdfd; }
.link-table > .link-table__more { grid-column: 1 / -1; justify-content: center; border-right: 0; border-bottom: 0; color: var(--c-teal); font-weight: 600; font-size: var(--fs-sm); }
.link-table .i { width: 31px; height: 31px; color: var(--c-teal); stroke-width: 1.3; }

/* ===== Badges ===== */
.badge { display: inline-flex; align-items: center; min-height: 22px; padding: 0 8px; border-radius: 2px; font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: .02em; }
.badge--green { background: var(--c-green); color: var(--c-white); }
.badge--grey { background: var(--c-bg-alt); color: var(--c-text-muted); text-transform: none; font-weight: 600; }
.badge--orange { background: var(--c-orange); color: var(--c-white); }
.status--done { color: var(--c-green-text); font-weight: 600; }

/* ===== Tabs: "In progress | Previous (1)" ===== */
.tabs { display: flex; gap: var(--sp-5); }
.tabs a, .tabs button { padding: 0 0 12px; border: 0; background: none; color: var(--c-text-muted); font-size: var(--fs-sm); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -15px; }
.tabs .is-active { color: var(--c-text); font-weight: 600; border-bottom-color: var(--c-teal); }

/* ===== Empty state ===== */
.empty { display: flex; flex-direction: column; align-items: center; gap: var(--sp-2); padding: var(--sp-10) var(--sp-4); text-align: center; color: var(--c-text-muted); font-size: 13px; }
.empty .i { width: 22px; height: 22px; color: var(--c-text-2); }
.empty p { max-width: 140px; }

/* ===== Breadcrumb pills ===== */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; margin: 0; padding: 0; list-style: none; font-size: var(--fs-xs); }
.crumbs li { display: flex; }
.crumbs a, .crumbs span {
  display: inline-flex; align-items: center; min-height: 28px; padding: 0 16px 0 12px;
  background: rgba(17, 22, 38, .07); color: var(--c-text-2);
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 50%, calc(100% - 8px) 100%, 0 100%, 8px 50%);
}
.crumbs li:first-child a { clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 50%, calc(100% - 8px) 100%, 0 100%); padding-left: 14px; }
.crumbs a:hover { background: rgba(17, 22, 38, .12); color: var(--c-text); }
.crumbs [aria-current] { background: none; color: var(--c-text); clip-path: none; }

/* ===== Modal ===== */
.modal { position: fixed; inset: 0; z-index: 900; display: none; align-items: flex-start; justify-content: center; padding: 8vh var(--gutter) var(--gutter); background: var(--overlay); overflow-y: auto; }
.modal.is-open { display: flex; }
.modal__dialog { position: relative; width: 100%; max-width: 330px; background: var(--c-white); border-radius: var(--radius); box-shadow: var(--shadow-modal); }
.modal__dialog--md { max-width: 400px; }
.modal__dialog--lg { max-width: 364px; }
.modal__dialog--xl { max-width: 545px; }
.modal__dialog--terms { max-width: 845px; }
.modal__body { padding: 28px 28px 24px; }
.modal__title { margin: 0 0 var(--sp-3); font-size: var(--fs-md); font-weight: 700; padding-right: var(--sp-6); }
.modal__text { margin-bottom: var(--sp-5); font-size: 13px; color: var(--c-text-2); }
.modal__close { position: absolute; top: 14px; right: 14px; width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; border: 0; background: none; color: var(--c-teal); }
.modal__close:hover { color: var(--c-teal-dark); }
.modal__foot { display: flex; justify-content: flex-end; align-items: center; gap: var(--sp-5); margin-top: var(--sp-6); }
/* The teal-headed variant: "Edit information", "Change password", "Change address" */
.modal__head { display: flex; align-items: center; justify-content: space-between; padding: 0 28px; height: 64px; background: var(--c-teal); border-radius: var(--radius) var(--radius) 0 0; color: var(--c-white); }
.modal__head h2 { color: var(--c-white); font-size: var(--fs-md); }
.modal__head button { border: 0; background: none; color: var(--c-white); font-size: var(--fs-sm); opacity: .9; }
.modal__head button:hover { opacity: 1; }
.modal__choices { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--c-border); }
.modal__choices button, .modal__choices a {
  display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 46px; padding: 0 10px;
  border: 0; border-bottom: 1px solid var(--c-border); background: none; color: var(--c-text); font-size: 13px; text-align: left;
}
.modal__choices button:hover, .modal__choices a:hover { color: var(--c-teal); }
body.has-modal { overflow: hidden; }

/* ===== Toast: "✓ Product added to cart!  OK" ===== */
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 950; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  display: inline-flex; align-items: center; gap: var(--sp-3); padding: 6px 6px 6px 14px;
  background: var(--c-green); color: var(--c-white); border-radius: 999px; font-size: var(--fs-sm); font-weight: 600; box-shadow: var(--shadow-pop);
  transition: opacity .2s var(--ease), transform .2s var(--ease); }
.toast.is-shown { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast--error { background: var(--c-orange); }
.toast button { border: 0; border-radius: 999px; padding: 3px 10px; background: rgba(255, 255, 255, .25); color: var(--c-white); font-size: var(--fs-xs); font-weight: 700; }

/* ===== Diagonal colour shapes (heroes, CTA band, breadcrumb bar) ===== */
.shape { position: absolute; transform: skewX(-20deg); pointer-events: none; }
.shape--yellow { background: var(--c-yellow); }
.shape--teal { background: var(--c-teal); }
.shape--salmon { background: var(--c-salmon); }
.shape--mint { background: var(--c-teal-pale); }
.shape--olive { background: #d7d36a; }
.shape--pale-yellow { background: var(--c-yellow-pale); }
.shape--pale-pink { background: var(--c-pink-pale); }

/* ===== Tagline: "Speed. Warranty. Everywhere." ===== */
.tagline { padding: 96px var(--gutter) 120px; text-align: center; }
.tagline__eyebrow { margin-bottom: var(--sp-3); color: var(--c-teal); font-size: var(--fs-sm); font-weight: 700; letter-spacing: .02em; }
.tagline__text { font-size: var(--fs-2xl); font-weight: 400; }
.tagline__text strong { font-weight: 800; }

/* ===== Pager ===== */
.pager { display: flex; justify-content: center; gap: 4px; margin-top: var(--sp-8); }
.pager__pages a, .pager__pages span { min-width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; padding: 0 10px; border: 1px solid var(--c-border); background: var(--c-white); color: var(--c-text); font-size: 13px; }
.pager__pages a:hover { border-color: var(--c-teal); color: var(--c-teal); }
.pager__pages [aria-current] { background: var(--c-teal); border-color: var(--c-teal); color: var(--c-white); }

/* ===== Notifications (TempData messages) ===== */
.notice { display: flex; gap: var(--sp-3); align-items: flex-start; margin-bottom: var(--sp-4); padding: 12px 14px; border-radius: var(--radius-sm); font-size: 13px; }
.notice--success { background: #e5f8ea; color: #1f7a3a; }
.notice--error { background: var(--c-red-soft); color: #b3392f; }
.notice--info { background: var(--c-teal-pale); color: #126b6b; }

/* ===== Notice dialog (TempData outcome, Views/Shared/_Notifications.cshtml) ===== */
.notice-dialog { width: calc(100% - 2 * var(--gutter)); max-width: 360px; padding: 0; border: 0; border-radius: var(--radius); box-shadow: var(--shadow-modal); color: var(--c-text); }
.notice-dialog::backdrop { background: var(--overlay); }
.notice-dialog:not([open]) { display: none; }
.notice-dialog[open]:not(:modal) { position: fixed; top: 20vh; z-index: 960; margin: 0 auto; left: 0; right: 0; }
.notice-dialog__body { position: relative; display: flex; flex-direction: column; align-items: flex-start; padding: 28px; }
.notice-dialog__close { position: absolute; top: 14px; right: 14px; border: 0; background: none; color: var(--c-teal); }
.notice-dialog__icon { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; margin-bottom: 12px; border-radius: 50%; background: var(--c-teal-pale); color: var(--c-teal-dark); }
.notice-dialog--error .notice-dialog__icon { background: var(--c-red-soft); color: #d8463a; }
.notice-dialog--success .notice-dialog__icon { background: #e5f8ea; color: var(--c-green-text); }
.notice-dialog__title { margin-bottom: 6px; font-size: var(--fs-md); }
.notice-dialog__text { margin-bottom: 20px; font-size: 13px; color: var(--c-text-2); }
.notice-dialog__ok { align-self: flex-end; }

/* Category icons: the reference's sprite (assets/img/category-icons.svg), one 40 px row per
   icon, grey then teal. --cat is the grey row; --s the size it is drawn at. */
.cat-ico { --s: 28px; display: inline-block; flex: none; width: var(--s); height: var(--s); background: url("../img/category-icons.svg") no-repeat 0 calc(var(--cat, 38) * var(--s) * -1) / var(--s) auto; }
.cat-ico--teal, a:hover > .cat-ico, a:focus-visible > .cat-ico { background-position-y: calc((var(--cat, 38) + 1) * var(--s) * -1); }
.link-table .cat-ico { --s: 30px; }
