/* Custom styles - animations, carousel, and effects not covered by Tailwind utilities */

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(50px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-50px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(194, 85, 31, 0.3); }
    50% { box-shadow: 0 0 0 8px rgba(194, 85, 31, 0); }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

.animate-fade-in-up {
    animation: fadeInUp 0.5s ease-out;
}

.animate-slide-in-right {
    animation: slideInRight 0.4s ease-out;
}

.animate-slide-in-left {
    animation: slideInLeft 0.4s ease-out;
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

/* Hero decorations */
.hero__decor {
    position: absolute;
    top: 0;
    right: 0;
    width: 50%;
    height: 100%;
    background: radial-gradient(ellipse at center, rgba(255, 143, 80, 0.07) 0%, transparent 70%);
    pointer-events: none;
}

/* Product tabs */
.tab-panel[hidden] {
    display: none;
}

/* Carousel */
[data-carousel] {
    position: relative;
}
.carousel__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: background 0.2s;
}
.carousel__nav:hover {
    background: #f8fafc;
}
.carousel__nav--prev { left: -20px; }
.carousel__nav--next { right: -20px; }

/* FAQ accordion
   The <details> carries no padding of its own — the summary and answer each
   provide their own, which previously stacked to a 32px inset. */
details.faq__item {
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    transition: border-color 0.2s;
}
details.faq__item:hover {
    border-color: #ffcfb2;
}
details.faq__item[open] {
    border-color: #ffad82;
}
details.faq__item[open] .faq__answer {
    animation: fadeInUp 0.3s ease-out;
}
/* The summary is a flex row, which suppresses the default disclosure triangle
   in Firefox/Safari; hide the WebKit one explicitly for consistency. */
details.faq__item > summary::-webkit-details-marker {
    display: none;
}
details.faq__item[open] > summary .icon-chevron {
    transform: rotate(180deg);
}
details.faq__item > summary .icon-chevron {
    transition: transform 0.2s ease;
}

/* Enquiry cart slide */
.enquiry-cart {
    transition: transform 0.3s ease;
}
.enquiry-cart:not([hidden]) {
    transform: translateX(0);
}

/* Sticky actions */
.sticky-actions {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 40;
    background: white;
    border-top: 1px solid #e2e8f0;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
    display: none;
}
@media (max-width: 768px) {
    .sticky-actions {
        display: block;
    }
}
.sticky-actions__inner {
    display: flex;
    justify-content: space-around;
    padding: 0.5rem;
}
.sticky-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: #475569;
    text-decoration: none;
    padding: 0.25rem;
}
.sticky-action svg {
    width: 24px;
    height: 24px;
    color: #c2551f;
}

/* Mobile menu */
.mobile-menu:not([hidden]) {
    display: flex;
}

/* Hamburger -> X. The menu lives outside <header> now, but the button is still
   in the header, so the state has to be read from the toggle's own attribute. */
.menu-toggle__block {
    transition: transform 0.25s ease, opacity 0.2s ease, margin 0.25s ease;
}
.menu-toggle[aria-expanded="true"] .menu-toggle__block:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}
.menu-toggle[aria-expanded="true"] .menu-toggle__block:nth-child(2) {
    opacity: 0;
}
.menu-toggle[aria-expanded="true"] .menu-toggle__block:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

/* Reading-progress bar under the sticky header. */
[data-header-progress] {
    transition: width 0.1s linear;
}
.site-header.is-scrolled {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}
.mobile-menu__panel {
    display: flex;
    flex-direction: column;
    max-height: 100vh;
    overscroll-behavior: contain;
}
.mobile-menu__nav {
    flex: 1 1 auto;
    min-height: 0;
}
.mobile-menu__actions {
    flex-shrink: 0;
}

/* Search overlay */
.search-overlay:not([hidden]) {
    display: block;
}

/* Open/close choreography. The dialog animates via [data-search-dialog]; the
   backdrop fades separately so the two never fight over opacity. */
.search-overlay.is-open .search-overlay__backdrop {
    opacity: 1;
}
.search-overlay.is-open [data-search-dialog] {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* The wrapper scrolls, so the dialog must not be taller than the viewport on
   short phones. dvh tracks the dynamic viewport as browser chrome collapses. */
.search-overlay__wrap {
    max-height: 100dvh;
}
.search-dialog {
    max-height: calc(100dvh - 2rem);
    overflow-y: auto;
    overscroll-behavior: contain;
}
@media (min-width: 640px) {
    .search-dialog {
        max-height: calc(100dvh - 10rem);
    }
}

/* Kill the WebKit "cancel" affordance on type=search so the custom clear
   button is the only one on screen. */
.search-input::-webkit-search-cancel-button,
.search-input::-webkit-search-decoration {
    -webkit-appearance: none;
    appearance: none;
}

/* Inline search form on the results page */
.search-form--inline .search-input--lg {
    border-radius: 0.75rem;
}

/* Keyboard hint chips (also used in the dialog footer) */
.kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.5rem;
    height: 1.5rem;
    padding: 0 0.375rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.75rem;
    line-height: 1;
    color: #475569;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-bottom-width: 2px;
    border-radius: 0.375rem;
}

/* Respect users who ask for less motion: no slide/scale, instant show. */
@media (prefers-reduced-motion: reduce) {
    .search-overlay__backdrop,
    [data-search-dialog] {
        transition: none;
    }
    .search-overlay.is-open [data-search-dialog] {
        transform: none;
    }
}

/* Gallery thumbs active */
.gallery__thumb.is-active {
    border-color: #c2551f;
    box-shadow: 0 0 0 2px #c2551f;
}

/* Filter active */
.filter-link--active {
    background-color: #c2551f;
    color: white;
    border-color: #c2551f;
}

/* Pagination current */
.pagination__link--current {
    background-color: #c2551f;
    color: white;
    border-color: #c2551f;
}

/* Badge styles */
.badge--bestseller { background: #ffe8dc; color: #9c4018; }
.badge--popular { background: #fef3c7; color: #92400e; }
.badge--new { background: #dcfce7; color: #166534; }
.badge--sale { background: #fee2e2; color: #991b1b; }

/* Tab buttons */
.tab-button.active {
    color: #c2551f;
    border-bottom: 2px solid #c2551f;
}

/* Policy document */
.policy-document h2 {
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
}
.policy-document ul {
    list-style: disc;
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}
.policy-document ul li {
    margin-bottom: 0.5rem;
}

/* Spec table */
.spec-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}
.spec-table th, .spec-table td {
    padding: 0.5rem 0.75rem;
    border: 1px solid #e2e8f0;
    text-align: left;
}
.spec-table th {
    background: #f8fafc;
    font-weight: 600;
}

/* Tick list */
.tick-list li {
    padding: 0.25rem 0;
}

/* Hero map */
.map-wrapper {
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
}

/* Offer card */
.offer-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 1.5rem;
    text-align: center;
    transition: box-shadow 0.2s, transform 0.2s;
}
.offer-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}

/* Steps */
.steps {
    list-style: none;
    padding: 0;
    counter-reset: step;
}
.step {
    position: relative;
    padding-left: 4rem;
    padding-bottom: 2rem;
}
.step::before {
    counter-increment: step;
    content: counter(step);
    position: absolute;
    left: 0;
    top: 0;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: #c2551f;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.125rem;
}
.step:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 1.25rem;
    top: 2.5rem;
    width: 2px;
    height: calc(100% - 2.5rem);
    background: #e2e8f0;
}

/* Why us */
.why-us__list li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.375rem 0;
}
.why-us__list .icon {
    flex-shrink: 0;
    margin-top: 0.25rem;
    color: #16a34a;
}

/* Contact
   Breakpoint matches the markup's `lg:grid-cols-2` (1024px). Previously this
   forced two columns from 768px, which was far too cramped on tablets. */
.contact__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}
@media (min-width: 1024px) {
    .contact__grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* Team */
.team__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
}
.team__card {
    text-align: center;
}
.team__img {
    border-radius: 50%;
    width: 100%;
    max-width: 200px;
    margin: 0 auto 1rem;
}
.team__name {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}
.team__role {
    color: #64748b;
    font-size: 0.875rem;
}

/* Stats */
.stats__grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}
@media (min-width: 768px) {
    .stats__grid {
        grid-template-columns: repeat(4, 1fr);
    }
}
.stat__num {
    font-size: 2rem;
    font-weight: 800;
    color: #c2551f;
}
.stat__label {
    color: #64748b;
    font-size: 0.875rem;
}

/* Footer ----------------------------------------------------------------
   Shop matte: absolute bottom-right box on small screens' wider siblings,
   turned back into a normal grid cell from 768px. */
.footer__shop {
    position: absolute;
    right: 0;
    bottom: 0;
    background: transparent url('../images/background/shop-bluematte.png') 0 0 no-repeat;
    background-size: 360px 252px;
    width: 360px;
    height: 252px;
    overflow: hidden;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
    padding-top: 95px;
    padding-left: 50px;
    padding-right: 1.5rem;
    z-index: 20;
    /* The caption sits on the artwork, so it needs its own contrast against
       the matte instead of inheriting the footer's white-on-blue. */
    text-shadow: 0 1px 3px rgba(15, 23, 42, 0.55);
}
/* Phones: no room for the matte, the contact details take the full width. */
@media (max-width: 767px) {
    .footer__shop {
        display: none;
    }
}
/* Two-column footer: the box drops out of flow and becomes the right cell.
   It is capped at the artwork's own size and keeps its 360:252 ratio, so the
   picture scales down rather than being cropped in a narrow column. */
@media (min-width: 768px) {
    .footer__shop {
        position: static;
        width: 100%;
        max-width: 360px;
        height: auto;
        aspect-ratio: 360 / 252;
        margin-left: auto;
        background-size: contain;
        background-position: center top;
    }
}
/* Footer payments */
.footer__payments img {
    margin-left: 0.5rem;
}

/* Image Zoom Modal
   The dialog is a flex column: the image takes the free space and the thumbnail
   strip is a real footer row. It used to be an absolutely positioned strip, so
   with more than a handful of images the row grew past the viewport and the
   outer thumbnails were centred off-screen and unreachable. */
.zoom-modal {
    animation: fadeIn 0.2s ease-out;
}
/* The dialog is display:flex (Tailwind) and toggled with `hidden`. Pin the
   hidden state here so it cannot lose to the flex utility on class order. */
.zoom-modal.hidden {
    display: none;
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
.zoom-modal__content {
    animation: zoomIn 0.2s ease-out;
}
@keyframes zoomIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}
.zoom-modal__nav {
    transition: opacity 0.2s, transform 0.2s;
}
.zoom-modal__nav:hover {
    background: rgba(0,0,0,0.7) !important;
    transform: scale(1.05);
}
.zoom-modal__nav:active {
    transform: scale(0.95);
}
.zoom-modal__close:hover {
    background: rgba(0,0,0,0.7) !important;
}
.zoom-thumb {
    transition: border-color 0.2s, transform 0.2s;
}
.zoom-thumb:hover {
    transform: scale(1.05);
}
.zoom-thumb.border-primary-500 {
    border-color: #c2551f !important;
}
.zoom-modal__thumbs {
    display: flex;
    gap: 0.5rem;
    /* Scrolls horizontally instead of overflowing, and keeps the padding
       clear of the iOS home indicator. */
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 0.5rem 0.75rem calc(0.5rem + env(safe-area-inset-bottom, 0px));
}
.zoom-modal__thumbs::-webkit-scrollbar {
    display: none;
}
.zoom-thumb {
    flex: 0 0 auto;
    width: 56px;
    height: 56px;
}
.zoom-hint {
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
}
@media (min-width: 768px) {
    .zoom-thumb {
        width: 64px;
        height: 64px;
    }
}
@media (max-width: 768px) {
    .zoom-modal__nav {
        width: 44px;
        height: 44px;
    }
    .zoom-modal__nav--prev { left: 8px; }
    .zoom-modal__nav--next { right: 8px; }
    .zoom-modal__close { top: 8px; right: 8px; }
}
@media (prefers-reduced-motion: reduce) {
    .zoom-modal,
    .zoom-modal__content,
    .zoom-thumb,
    .zoom-modal__nav,
    .gallery__main,
    .gallery__thumbs button,
    .option-choice {
        animation: none;
        transition: none;
    }
}

/* Product Detail Page
   The page is a single stacked column on phones and a two-column grid from
   768px. Everything position:sticky and the viewport-height maths are therefore
   scoped to the two-column layout: a sticky square gallery in the stacked
   layout used to pin itself over the copy scrolling underneath it. */
.product-detail {
    /* Clears the sticky site header (~68px) plus a little breathing room. */
    --pd-sticky-offset: 84px;
}
.product-detail__grid {
    align-items: start;
}
.product-detail__title,
.product-detail__desc,
.product-detail__text {
    overflow-wrap: break-word;
}
.product-detail__about {
    max-width: 70ch;
}
.product-detail__actions .btn {
    min-height: 48px;
}

/* Breadcrumbs ---------------------------------------------------------- */
.breadcrumbs {
    background-color: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}
.breadcrumbs__list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.125rem 0.25rem;
    padding: 0.625rem 0;
    font-size: 0.8125rem;
    line-height: 1.4;
}
/* min-width:0 lets a long product name shrink and ellipsise instead of
   forcing the whole trail onto a second line. */
.breadcrumbs__item {
    display: inline-flex;
    align-items: center;
    min-width: 0;
}
.breadcrumbs__sep {
    display: inline-flex;
    align-items: center;
    color: #cbd5e1;
    flex: 0 0 auto;
}
.breadcrumbs__sep svg {
    width: 0.875rem;
    height: 0.875rem;
}
.breadcrumbs__link,
.breadcrumbs__current {
    display: inline-flex;
    align-items: center;
    gap: 0.3125rem;
    min-width: 0;
    max-width: 20rem;
    padding: 0.125rem 0.25rem;
    border-radius: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.breadcrumbs__link {
    color: #475569;
    transition: color 0.15s ease, background-color 0.15s ease;
}
.breadcrumbs__link:hover {
    color: #9c4018;
    background-color: #fff6f1;
}
.breadcrumbs__link:focus-visible {
    outline: 2px solid #c2551f;
    outline-offset: 1px;
}
/* The page you are on is the one that should stand out, not fade back. */
.breadcrumbs__current {
    color: #0f172a;
    font-weight: 500;
}
@media (max-width: 639px) {
    /* A four-step trail cannot fit 360px without clipping the product name, so
       it wraps to a second line. Tighten the box so two lines stay compact. */
    .breadcrumbs__list {
        gap: 0 0.125rem;
        padding: 0.4375rem 0;
    }
    .breadcrumbs__link,
    .breadcrumbs__current {
        padding: 0.125rem;
        max-width: 100%;
    }
}
@media (min-width: 640px) {
    .breadcrumbs__list {
        font-size: 0.875rem;
    }
    .breadcrumbs__link,
    .breadcrumbs__current {
        max-width: 26rem;
    }
}

/* Gallery ------------------------------------------------------------- */
.gallery__main {
    position: relative;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transition: box-shadow 0.25s ease;
}
.gallery__main:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}
/* The main image doubles as a button, so it needs a visible focus ring. */
.gallery__main:focus-visible {
    outline: 3px solid #c2551f;
    outline-offset: 3px;
}
/* Thumbs size themselves to the column instead of being pinned to 4 columns,
   which made each one enormous on desktop. */
.gallery__thumbs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 0.5rem;
}
.gallery__thumb {
    max-width: 96px;
    transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.gallery__thumb:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.gallery__thumb:focus-visible {
    outline: 2px solid #c2551f;
    outline-offset: 2px;
}
/* The active-thumb styling lives with the other .gallery__thumb rules above
   ("Gallery thumbs active"); it beats the base border-slate-200 on specificity,
   so no !important is needed. */

@media (min-width: 768px) {
    .product-detail__gallery {
        position: sticky;
        top: var(--pd-sticky-offset);
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
    }
    /* The frame must NOT be absolutely positioned or flex-shrunk: the uploaded
       image has to stay in flow and drive the height, otherwise the frame
       collapses to the height of the zoom hint and no image is visible.
       max-height is applied to the image itself, so a tall upload shrinks
       proportionally (CSS2.1 max-height recomputes the width) instead of
       being cropped. The 7rem reserve keeps one thumbnail row on screen. */
    .product-detail__gallery .gallery__main {
        flex: 0 0 auto;
    }
    .product-detail__gallery .gallery__main img {
        width: 100%;
        height: auto;
        max-height: calc(100dvh - var(--pd-sticky-offset) - 7rem);
        aspect-ratio: auto;
        object-fit: contain;
    }
    .product-detail__gallery .gallery__thumbs {
        flex: 0 0 auto;
    }
}

/* Thumbnails keep their own object-contain utility in the markup so the whole
   uploaded picture is visible instead of a centre crop. */

/* Info column --------------------------------------------------------- */
.product-detail__desc {
    font-size: 1.0625rem;
    line-height: 1.7;
}
@media (max-width: 767px) {
    .product-detail__desc {
        font-size: 1rem;
        line-height: 1.6;
    }
}
.product-sku {
    background: #f8fafc;
    padding: 1rem;
    border-radius: 8px;
    margin-top: 0.5rem;
}
@media (min-width: 768px) {
    /* Only the two-column layout gets the sticky panel, and only there is the
       extra height capped: an inner scroll region inside the page scroll is
       unusable on a phone. */
    .product-detail__panel {
        position: sticky;
        top: var(--pd-sticky-offset);
        max-height: calc(100dvh - var(--pd-sticky-offset) - 1.5rem);
        overflow-y: auto;
        overscroll-behavior: contain;
        scrollbar-width: thin;
        scrollbar-gutter: stable;
    }
}

/* Options ------------------------------------------------------------- */
.option-group {
    padding: 1rem;
    background: #fafafa;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}
@media (min-width: 768px) {
    .option-group {
        padding: 1.5rem;
    }
}
.option-group:not(:last-child) {
    margin-bottom: 1rem;
}
.option-choices {
    /* min() keeps a single column from overflowing a very narrow container. */
    grid-template-columns: repeat(auto-fit, minmax(min(140px, 100%), 1fr));
}
.option-choice {
    transition: all 0.2s ease;
}
.option-label {
    min-height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    word-break: break-word;
    overflow-wrap: anywhere;
}
.option-input:checked + .option-label {
    border-color: #c2551f;
    background-color: #fff6f1;
    color: #9c4018;
    box-shadow: 0 0 0 3px rgba(194, 85, 31, 0.18);
}
.option-input:focus-visible + .option-label {
    outline: 2px solid #c2551f;
    outline-offset: 2px;
}
.option-input:disabled + .option-label {
    opacity: 0.5;
    cursor: not-allowed;
}

.badge {
    font-weight: 600;
}
.btn--primary {
    font-weight: 600;
    letter-spacing: 0.01em;
}
.product-detail__category {
    letter-spacing: 0.05em;
}
.product-detail__title {
    letter-spacing: -0.02em;
}
.product-related {
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
}
.section__head {
    margin-bottom: 3rem;
}
@media (max-width: 767px) {
    .section__head {
        margin-bottom: 2rem;
    }
}
.section__title {
    position: relative;
    display: inline-block;
}
.section__title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #ff8f50, #f4762f);
    border-radius: 2px;
}
.section__intro {
    font-size: 1.125rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}
.product-card {
    transition: all 0.3s ease;
}
.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}
@media (max-width: 767px) {
    .product-card:hover {
        transform: none;
    }
}
