/* Appearance only. The scale1 type/rhythm, control geometry and application
   state machines remain authoritative. All colors are from the existing palette. */
:root {
    --component-control-radius: 6px;
    --component-panel-radius: 12px;
    --component-border: #cdbb9f;
    --component-border-hover: #9e7a46;
    --component-ink: #352419;
    --component-primary: #352419;
    --component-primary-hover: #4b3322;
    --component-primary-text: #fffaf1;
    --component-surface: #fffdf8;
    --component-surface-hover: #f2ecdf;
    --component-focus: #8b642b;
    --component-selected: #f2e8d6;
    --component-selected-border: #bca276;
    --component-muted: #74654f;
    --component-disabled: #e7dfd1;
    --component-danger: #873b2e;
    --component-danger-border: #bd8f78;
    --component-danger-bg: #fff8f2;
    --component-danger-hover: #f5e5db;
    --component-invalid: #a33e31;
    --component-readonly: #f3ecdf;
}
body.storefront {
    --fc-control-radius: var(--component-control-radius);
    --fc-panel-radius: var(--component-panel-radius);
    --fc-control-line: var(--component-border);
    --fc-control-ink: var(--component-primary);
    --fc-control-hover: var(--component-primary-hover);
    --fc-control-paper: var(--component-primary-text);
    --fc-control-soft: var(--component-selected);
    --fc-control-focus: var(--component-focus);
    --product-photo-line: var(--component-border);
}

/* Common shape, with distinct action semantics. Official provider buttons,
   plain navigation links and round image actions retain their established forms. */
:is(body.storefront,body.customer-app,body.editor-app) .button:not(.google-auth-button),
body.storefront :is(.search-submit,.apply-filters,.product-compare-detail,.product-compare-open,.recently-viewed-arrow),
body.storefront.page-product .gallery-product-page .detail-save {
    border-radius: var(--component-control-radius);
    box-shadow: none;
    transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease;
}
:is(body.storefront,body.customer-app,body.editor-app) .button:not(.google-auth-button):hover { transform: none; box-shadow: none; }
body.storefront .button-dark:not(.fc-atelier-cta),
body.storefront :is(.search-submit,.apply-filters,.product-compare-open),
body.storefront.page-product .gallery-product-page .detail-save {
    background: var(--component-primary); border-color: var(--component-primary); color: var(--component-primary-text); box-shadow: none;
}
body.storefront .button-dark:not(.fc-atelier-cta):hover:not(:disabled),
body.storefront :is(.search-submit,.apply-filters,.product-compare-open):hover:not(:disabled),
body.storefront.page-product .gallery-product-page .detail-save:hover:not(:disabled) {
    background: var(--component-primary-hover); border-color: var(--component-primary-hover); color: var(--component-primary-text);
}
body.storefront :is(.button-outline,.product-compare-detail),
body.storefront.page-oem .oem-page .button-outline {
    background: var(--component-surface); border-color: var(--component-border); color: var(--component-ink); box-shadow: none;
}
body.storefront :is(.button-outline,.product-compare-detail):hover:not(:disabled),
body.storefront.page-oem .oem-page .button-outline:hover:not(:disabled) {
    background: var(--component-surface-hover); border-color: var(--component-border-hover); color: var(--component-ink);
}
body.storefront :is(.site-footer,.contact-hero,.home-campaign,.cert-hero) .button-outline {
    background: transparent; color: var(--component-primary-text); border-color: var(--component-border);
}
body.storefront :is(.site-footer,.contact-hero,.home-campaign,.cert-hero) .button-outline:hover:not(:disabled) {
    background: var(--component-surface-hover); color: var(--component-ink); border-color: var(--component-border-hover);
}
body.storefront a.button.fc-atelier-cta:any-link { border-radius: var(--component-control-radius); box-shadow: none; }
body.storefront.page-product .gallery-product-page .detail-save:is(.is-saved,[aria-pressed='true']),
body.storefront .product-compare-detail.is-selected {
    background: var(--component-selected); border-color: var(--component-selected-border); color: var(--component-ink);
}
body.storefront.page-product .gallery-product-page .detail-save:is(.is-saved,[aria-pressed='true']):hover:not(:disabled),
body.storefront .product-compare-detail.is-selected:hover:not(:disabled) {
    background: var(--component-selected); border-color: var(--component-border-hover); color: var(--component-ink);
}
body.storefront :is(.button,.search-submit,.apply-filters,.product-compare-open,.product-compare-detail,.detail-save):disabled,
body.storefront.page-product .gallery-product-page .detail-save:disabled,
body.storefront .product-compare-detail.is-selected:disabled {
    background: var(--component-disabled); color: var(--component-muted); border-color: var(--component-border);
    box-shadow: none; opacity: 1;
}

/* Boxed fields use the same surface and states. Search is a composite field:
   its wrapper owns the frame, while its inner text input stays borderless. */
body.storefront :is(.oem-enquiry,.enquiry-basket-dialog) .enquiry-field :is(input,textarea),
body.storefront :is(.sort-control select,.filter-group select,.fc-select__trigger) {
    border: 1px solid var(--component-border); border-radius: var(--component-control-radius);
    background-color: var(--component-surface); background-image: none;
    color: var(--component-ink); box-shadow: none;
    transition: border-color 180ms ease, background-color 180ms ease;
}
body.storefront .catalog-search { border-color: var(--component-border); border-radius: var(--component-control-radius); background: var(--component-surface); box-shadow: none; }
body.storefront .catalog-search input { background: transparent; box-shadow: none; }
body.storefront :is(.oem-enquiry,.enquiry-basket-dialog) .enquiry-field :is(input,textarea):hover:not(:disabled):not([readonly]):not([aria-invalid='true']),
body.storefront :is(.sort-control select,.filter-group select,.fc-select__trigger):hover:not(:disabled):not([aria-invalid='true']) { border-color: var(--component-border-hover); }
body.storefront :is(.oem-enquiry,.enquiry-basket-dialog) .enquiry-field :is(input,textarea):focus,
body.storefront :is(.sort-control select,.filter-group select,.fc-select__trigger):focus,
body.storefront .catalog-search:focus-within { border-color: var(--component-focus); background-image: none; box-shadow: none; }
body.storefront :is(.oem-enquiry,.enquiry-basket-dialog) .enquiry-field :is(input,textarea):focus-visible,
body.storefront :is(.button,.search-submit,.apply-filters,.detail-save,.product-compare-detail,.product-compare-open,.fc-select__trigger):focus-visible,
body.storefront .catalog-search:focus-within {
    outline: 2px solid var(--component-focus); outline-offset: 3px;
}
body.storefront :is(.oem-enquiry,.enquiry-basket-dialog) .enquiry-field :is(input,textarea)[aria-invalid='true'] {
    border: 1px solid var(--component-invalid); background-color: var(--component-danger-bg); background-image: none;
}
body.storefront :is(.oem-enquiry,.enquiry-basket-dialog) .enquiry-field [aria-invalid='true']:focus-visible { outline-color: var(--component-invalid); }
body.storefront :is(.sort-control select,.filter-group select)[aria-invalid='true'],
body.storefront .fc-select .fc-select__trigger[aria-invalid='true'] { border-color: var(--component-invalid); }
body.storefront :is(.sort-control select,.filter-group select)[aria-invalid='true']:focus-visible,
body.storefront .fc-select .fc-select__trigger[aria-invalid='true']:focus-visible { outline-color: var(--component-invalid); }
body.storefront :is(.oem-enquiry,.enquiry-basket-dialog) .enquiry-field :is(input,textarea)[readonly] { background-color: var(--component-readonly); opacity: 1; }
body.storefront :is(.oem-enquiry,.enquiry-basket-dialog) .enquiry-field :is(input,textarea):disabled {
    border: 1px solid var(--component-border); background-color: var(--component-disabled); color: var(--component-muted); opacity: 1;
}
body.storefront .site-language .site-language-trigger { border-radius: var(--component-control-radius); }

/* Border is the elevation for normal panels. Photo canvases remain white,
   retain their inset/fit, and get one frame rather than a second outer card. */
body.storefront .product-grid .product-card { border-color: transparent; border-radius: 0; background: transparent; box-shadow: none; }
body.storefront:not(.page-home) .product-grid .product-card { border: 0; border-radius: 0; background: transparent; box-shadow: none; }
body.storefront .product-grid .product-visual,
body.storefront:not(.page-home) .product-grid .product-visual,
body.storefront .brand-page-product-grid .product-visual,
body.storefront .recently-viewed-card .product-visual {
    border-color: var(--component-border); border-radius: var(--component-panel-radius); box-shadow: none;
}
body.storefront .product-grid .product-card:is(:hover,:focus-within),
body.storefront:not(.page-home) .product-grid .product-card:is(:hover,:focus-within) { border-color: transparent; box-shadow: none; }
body.storefront .product-grid .product-card:is(:hover,:focus-within) .product-visual,
body.storefront:not(.page-home) .product-grid .product-card:is(:hover,:focus-within) .product-visual { border-color: var(--component-border-hover); box-shadow: none; }
body.storefront.page-product .gallery-product-page .product-detail .detail-image,
body.storefront.page-brand .brand-page-image-stage {
    border-color: var(--component-border); border-radius: var(--component-panel-radius); box-shadow: none;
}
body.storefront.page-brand .brand-page-image-stage::before { content: none; }
body.storefront :is(.contact-enquiry-card,.cert-mark-image) {
    border-color: var(--component-border); border-radius: var(--component-panel-radius); background-color: var(--component-surface); box-shadow: none;
}
body.storefront .contact-enquiry-card:is(:hover,:focus-within) {
    border-color: var(--component-border-hover); background-color: var(--component-surface-hover); box-shadow: none; transform: none;
}
body.storefront .cert-mark-image:is(:hover,:focus-visible) { border-color: var(--component-border-hover); background-color: var(--component-surface-hover); box-shadow: none; }
body.storefront .contact-information { border-radius: var(--component-panel-radius); background-color: var(--component-surface); box-shadow: none; }
body.storefront :is(.contact-opening-hours,.visit-map) { border-radius: var(--component-panel-radius); box-shadow: none; }
body.storefront :is(.dialog-panel,.image-zoom-dialog,.enquiry-basket-dialog,.product-compare-dialog,#quick-view) { border-color: var(--component-border); border-radius: var(--component-panel-radius); }
body[data-public-not-found] .error-card { border-color: var(--component-border); border-radius: var(--component-panel-radius); background: var(--component-surface); box-shadow: none; }
body[data-public-not-found] :is(.error-action,.error-language-trigger) { border-radius: var(--component-control-radius); border-color: var(--component-border); }
body[data-public-not-found] .error-action-primary { background: var(--component-primary); color: var(--component-primary-text); border-color: var(--component-primary); }
body[data-public-not-found] .error-action-primary:hover { background: var(--component-primary-hover); border-color: var(--component-primary-hover); }
body[data-public-not-found] .error-action:not(.error-action-primary):hover { background: var(--component-surface-hover); border-color: var(--component-border-hover); }
body[data-public-not-found] :is(a,button,select):focus-visible { outline: 2px solid var(--component-focus); outline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
    :is(body.storefront,body.customer-app,body.editor-app) .button,
    body.storefront .enquiry-field :is(input,textarea) { transition: none; }
}
@media (forced-colors: active) {
    body.storefront :is(.button:not(.google-auth-button),.search-submit,.apply-filters,.detail-save,.product-compare-open,.product-compare-detail) { background: ButtonFace; color: ButtonText; border-color: ButtonText; }
    body.storefront :is(.oem-enquiry,.enquiry-basket-dialog) .enquiry-field :is(input,textarea) { background: Canvas; color: CanvasText; border-color: CanvasText; }
    body.storefront :is(.product-visual,.contact-enquiry-card,.cert-mark-image) { border-color: CanvasText; }
}
