:root {
    --shop-ink: #0f172a;
    --shop-muted: #64748b;
    --shop-paper: #f8fafc;
    --shop-accent: #4f46e5;
    --shop-accent-dark: #4338ca;
    --shop-line: #e2e8f0;
    --shop-shadow: 0 18px 45px rgba(15, 23, 42, .08);
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 6rem;
}

body {
    color: var(--shop-ink);
    background: #f8fafc;
}

::selection {
    color: #fff;
    background: var(--shop-accent);
}

:focus-visible {
    outline: 3px solid rgba(79, 70, 229, .45);
    outline-offset: 3px;
}

.cms-page {
    padding-block: clamp(2rem, 5vw, 4rem);
    background: #f8fafc;
}

.cms-page > div { max-width: 52rem; }

.cms-page article {
    overflow: hidden;
    border: 1px solid #e2e8f0;
    border-radius: 1.25rem;
    background: #fff;
    box-shadow: 0 12px 34px rgba(15, 23, 42, .055);
}

.cms-page article > div:first-child {
    background: linear-gradient(135deg, #f0fdfa 0%, #fff 72%);
}

.cms-page article h1 { text-wrap: balance; }

.cms-page article .prose {
    color: #334155;
    line-height: 1.8;
}

.cms-page article .prose :where(h2, h3, h4) {
    color: #0f172a;
    letter-spacing: -.025em;
    text-wrap: balance;
}

.cms-page article .prose :where(a) {
    color: #4338ca;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.invoice-fields {
    display: grid;
    gap: .85rem;
    padding: 1rem;
    border: 1px solid #dbe4ee;
    border-radius: 1rem;
    background: #f8fafc;
    color: #334155;
    font-size: .875rem;
}

.invoice-fields__toggle {
    display: flex;
    min-height: 2.75rem;
    align-items: center;
    gap: .65rem;
    font-weight: 700;
    color: #0f172a;
    cursor: pointer;
}

.invoice-fields__toggle input { width: 1.1rem; height: 1.1rem; accent-color: #0f766e; }

.invoice-fields__body {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .75rem;
    padding-top: .25rem;
}

.invoice-fields__body[hidden] { display: none; }

.invoice-fields__body label {
    display: grid;
    gap: .35rem;
    font-weight: 650;
}

.invoice-fields__body input {
    width: 100%;
    min-height: 2.75rem;
    padding: .6rem .75rem;
    border: 1px solid #cbd5e1;
    border-radius: .65rem;
    background: #fff;
    color: #0f172a;
    font-weight: 400;
}

.invoice-fields__body input:focus-visible {
    border-color: #0f766e;
    outline: 3px solid rgba(15, 118, 110, .18);
    outline-offset: 1px;
}

.invoice-fields__body button {
    min-height: 2.75rem;
    align-self: end;
    justify-self: start;
    padding: .55rem .85rem;
    border: 1px solid #b7e4d8;
    border-radius: .65rem;
    background: #ecfdf5;
    color: #065f46;
    font-weight: 700;
}

.invoice-fields__body [data-tax-status],
.invoice-fields__hint { grid-column: 1 / -1; margin: 0; color: #64748b; font-size: .78rem; line-height: 1.55; }

header {
    box-shadow: 0 8px 26px rgba(23, 36, 58, .055) !important;
}

.shop-topbar {
    color: #49635f !important;
    background: #eaf7f3 !important;
    border-color: #d2e9e2 !important;
}

.shop-topbar .text-amber-400 { color: #c84e2b !important; }
.shop-topbar .text-white { color: #0f766e !important; }
.shop-topbar .text-sky-400 { color: #087e8b !important; }

.shop-site-header {
    color: var(--shop-ink) !important;
    background: rgba(255, 255, 255, .97) !important;
    border-color: #e4e9e3 !important;
    box-shadow: 0 10px 28px rgba(23, 36, 58, .07) !important;
}

.shop-site-header .bg-gradient-to-tr,
.shop-site-header .bg-gradient-to-br {
    background-image: linear-gradient(135deg, #312e81, #4f46e5) !important;
}

.shop-site-header .text-indigo-600,
.shop-site-header .text-indigo-700,
.shop-site-header .hover\:text-indigo-600:hover {
    color: #4338ca !important;
}

.shop-site-header .border-indigo-600 {
    border-color: var(--shop-accent) !important;
}

.shop-site-header .bg-indigo-950 {
    background-color: #eef8f5 !important;
}

.shop-site-header .text-indigo-200 { color: #c7d2fe !important; }
.shop-site-header .border-indigo-900 { border-color: #312e81 !important; }

/* Keep the shared commerce header on the same two-row rhythm on every page. */
.shop-site-header > div > div:first-child {
    min-height: 76px;
}

.shop-site-header > div > div:first-child > nav {
    display: none !important;
}

.shop-site-header > div > div:last-child {
    background: #1e3a8a !important;
    border-color: #1e3a8a !important;
}

.shop-site-header > div > div:last-child a {
    color: #fff !important;
}

.shop-site-header > div > div:last-child a:hover {
    color: #c7d2fe !important;
}

header a,
header button,
.storefront-home a,
.storefront-home button {
    transition: color .2s ease, background-color .2s ease, border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.storefront-page button,
.storefront-page select {
    min-height: 44px;
}

.storefront-page input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="range"]) {
    min-height: 44px;
}

.storefront-page input[type="checkbox"],
.storefront-page input[type="radio"] {
    width: 1rem;
    height: 1rem;
    min-height: 1rem;
}

.storefront-page input,
.storefront-page select,
.storefront-page textarea {
    border-radius: .75rem;
}

.storefront-page :disabled {
    cursor: not-allowed;
    opacity: .6;
}

.storefront-page button:focus-visible,
.storefront-page a:focus-visible,
.storefront-page input:focus-visible,
.storefront-page select:focus-visible,
.storefront-page textarea:focus-visible {
    outline: 3px solid rgba(79, 70, 229, .35);
    outline-offset: 2px;
}

.storefront-home {
    max-width: 1440px;
    padding-top: clamp(1.25rem, 3vw, 2.5rem);
    padding-bottom: 4rem;
}

.storefront-home .home-hero {
    min-height: 420px;
    border-color: #cbd5e1;
    box-shadow: var(--shop-shadow);
}

.storefront-home .home-hero h1 {
    max-width: 18ch;
    font-size: clamp(2rem, 4vw, 3.75rem);
    line-height: 1.08;
    letter-spacing: -.04em;
    text-wrap: balance;
}

.storefront-home .home-hero p {
    max-width: 55ch;
    font-size: clamp(.95rem, 1.3vw, 1.05rem);
    line-height: 1.65;
}

.shop-site-header button,
.shop-site-header a,
.storefront-home a,
.storefront-home button {
    min-height: 44px;
}

.storefront-home .lg\:col-span-4.bg-white,
.category-showcase,
.repair-cta-section > div:last-child {
    border-color: var(--shop-line) !important;
    border-radius: 26px !important;
    box-shadow: 0 14px 36px rgba(15, 23, 42, .065) !important;
}

.category-showcase {
    padding: clamp(1rem, 2.5vw, 1.75rem) !important;
}

.category-grid > a {
    position: relative;
    isolation: isolate;
    display: flex;
    min-height: 150px;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-end;
    gap: .35rem;
    overflow: hidden;
    padding: 1rem !important;
    border: 0 !important;
    border-radius: 20px !important;
    color: #fff !important;
    text-align: left;
    background-color: #334155 !important;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18);
}

.category-grid > a::before,
.category-grid > a::after {
    position: absolute;
    z-index: -1;
    inset: 0;
    content: '';
}

.category-grid > a::before {
    background-image: var(--category-photo);
    background-position: center;
    background-size: cover;
    transition: transform .45s cubic-bezier(.2, .7, .2, 1);
}

.category-grid > a::after {
    background: linear-gradient(180deg, rgba(14, 24, 39, .02) 8%, rgba(14, 24, 39, .78) 100%);
}

.category-grid > a:hover::before {
    transform: scale(1.08);
}

.category-grid > a > span:first-child {
    display: none;
}

.category-grid > a > span:nth-child(2) {
    font-size: .95rem !important;
    line-height: 1.2 !important;
    text-wrap: balance;
}

.category-grid > a > span:nth-child(3) {
    font-size: .75rem !important;
    opacity: .88;
}

.category-grid > a:nth-child(1) { --category-photo: url('/images/store/store-hero-photo.webp'); }
.category-grid > a:nth-child(2) { --category-photo: url('/images/store/paper-photo.webp'); }
.category-grid > a:nth-child(3) { --category-photo: url('/images/store/writing-photo.webp'); }
.category-grid > a:nth-child(4) { --category-photo: url('/images/store/folders-photo.webp'); }
.category-grid > a:nth-child(5) { --category-photo: url('/images/store/notebooks-photo.webp'); }
.category-grid > a:nth-child(6) { --category-photo: url('/images/store/folders-photo.webp'); }
.category-grid > a:nth-child(7) { --category-photo: url('/images/store/printer-photo.webp'); }
.category-grid > a:nth-child(8) { --category-photo: url('/images/store/printer-photo.webp'); }

.home-product-grid > div {
    overflow: hidden;
    border-color: #e2e8f0 !important;
    border-radius: 22px !important;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .045) !important;
}

.home-product-grid > div:hover {
    border-color: #a5b4fc !important;
    box-shadow: 0 18px 34px rgba(15, 23, 42, .12) !important;
    transform: translateY(-4px);
}

.home-product-grid img {
    transition: transform .35s ease;
}

.storefront-home .bg-indigo-600 {
    background-color: var(--shop-accent) !important;
}

.storefront-home .hover\:bg-indigo-700:hover {
    background-color: var(--shop-accent-dark) !important;
}

.storefront-home .text-indigo-600,
.storefront-home .text-indigo-700 {
    color: #4338ca !important;
}

.storefront-home .border-indigo-200,
.storefront-home .border-indigo-300 {
    border-color: #c7d2fe !important;
}

.storefront-home a:active,
.storefront-home button:active {
    transform: translateY(1px) scale(.99);
}

@keyframes shop-rise {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (min-width: 1024px) {
    .category-grid > a { min-height: 172px; }
}

@media (max-width: 640px) {
    .storefront-home { padding-top: 1rem; }
    .storefront-home .home-hero { min-height: 0; }
    .shop-site-header > div > div:first-child { min-height: 64px; }
    .storefront-home .home-hero h1 { max-width: 18ch; }
    .category-grid > a { min-height: 138px; }
    .cms-page { padding-block: 1.5rem; }
    .cms-page article { border-radius: 1rem; }
    .invoice-fields__body { grid-template-columns: 1fr; }
    .invoice-fields__body [data-tax-status],
    .invoice-fields__hint { grid-column: auto; }
}

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