*,
*::before,
*::after {
    box-sizing: border-box;
}

:root {
    --bg: #f5efe7;
    --bg-deep: #efe4d6;
    --surface: rgba(255, 252, 247, 0.82);
    --surface-solid: #fffaf4;
    --surface-strong: #fff;
    --ink: #221b17;
    --muted: #6a5d53;
    --line: rgba(92, 71, 51, 0.12);
    --line-strong: rgba(92, 71, 51, 0.2);
    --accent: #ba5a31;
    --accent-strong: #8f3f1d;
    --accent-soft: #f3d7c7;
    --forest: #28483f;
    --shadow-lg: 0 24px 70px rgba(61, 37, 16, 0.12);
    --shadow-md: 0 16px 45px rgba(61, 37, 16, 0.1);
    --shadow-sm: 0 10px 24px rgba(61, 37, 16, 0.08);
    --radius-xl: 32px;
    --radius-lg: 24px;
    --radius-md: 18px;
    --radius-sm: 12px;
    --site-width: 1220px;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: "Manrope", "Helvetica Neue", Arial, sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.7), transparent 34%),
        radial-gradient(circle at 85% 12%, rgba(186, 90, 49, 0.12), transparent 22%),
        linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%);
    min-height: 100vh;
}

a {
    color: inherit;
}

img {
    display: block;
    max-width: 100%;
}

h1,
h2,
h3,
h4,
p {
    margin: 0;
}

h1,
h2,
h3,
h4 {
    font-family: "Fraunces", Georgia, serif;
    letter-spacing: -0.03em;
}

p {
    color: var(--muted);
    line-height: 1.6;
}

.site-shell {
    position: relative;
    overflow: hidden;
}

.site-shell::before,
.site-shell::after {
    content: "";
    position: fixed;
    inset: auto;
    pointer-events: none;
    z-index: -1;
    border-radius: 50%;
    filter: blur(12px);
}

.site-shell::before {
    width: 24rem;
    height: 24rem;
    top: 8rem;
    right: -8rem;
    background: rgba(40, 72, 63, 0.08);
}

.site-shell::after {
    width: 30rem;
    height: 30rem;
    bottom: -10rem;
    left: -8rem;
    background: rgba(186, 90, 49, 0.1);
}

.site-header,
.hero,
.collection-intro,
.products,
.page-hero,
.cart-layout,
.auth-layout,
.site-footer,
.flash-stack {
    width: min(calc(100% - 2rem), var(--site-width));
    margin-inline: auto;
}

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    padding: 1.2rem 1.5rem;
    margin-top: 1rem;
    position: sticky;
    top: 1rem;
    z-index: 20;
    background: rgba(255, 250, 244, 0.72);
    backdrop-filter: blur(18px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: var(--shadow-sm);
    border-radius: 999px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.9rem;
    text-decoration: none;
}

.brand img {
    width: 56px;
    height: 56px;
    border-radius: 18px;
    box-shadow: var(--shadow-sm);
}

.brand-copy {
    display: grid;
}

.brand-copy strong {
    font-size: 1rem;
    line-height: 1.1;
}

.catalog-search {
    flex: 1 1 360px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 220px;
}

.catalog-search input {
    min-width: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.88);
}

.search-submit {
    border: none;
    border-radius: 999px;
    padding: 0.82rem 1rem;
    background: rgba(34, 27, 23, 0.08);
    color: var(--ink);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.search-submit:hover,
.search-submit:focus-visible {
    background: rgba(34, 27, 23, 0.14);
    transform: translateY(-1px);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.site-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.site-nav a {
    text-decoration: none;
    padding: 0.72rem 1rem;
    border-radius: 999px;
    font-weight: 700;
    color: var(--muted);
    transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.site-nav a:hover,
.site-nav a:focus-visible {
    color: var(--ink);
    background: rgba(34, 27, 23, 0.06);
    transform: translateY(-1px);
}

.cart-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.cart-badge {
    min-width: 1.45rem;
    height: 1.45rem;
    padding: 0 0.35rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    font-size: 0.76rem;
    font-weight: 800;
    line-height: 1;
    box-shadow: 0 8px 18px rgba(186, 90, 49, 0.22);
}

.flash-stack {
    padding-top: 1rem;
    display: grid;
    gap: 0.75rem;
}

.flash-message {
    padding: 0.95rem 1.1rem;
    border-radius: var(--radius-md);
    background: rgba(255, 250, 244, 0.9);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
    color: var(--ink);
    font-weight: 600;
}

main {
    padding-bottom: 3rem;
}

.hero {
    padding: 4.5rem 0 2rem;
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.8fr);
    gap: 1.5rem;
    align-items: stretch;
}

.hero-content,
.hero-panel-card,
.page-hero,
.cart-summary,
.auth-card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.75), rgba(255, 250, 244, 0.9));
    border: 1px solid rgba(255, 255, 255, 0.55);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(18px);
}

.hero-content {
    padding: clamp(2rem, 4vw, 3.75rem);
    border-radius: var(--radius-xl);
    position: relative;
    overflow: hidden;
}

.hero-content:first-child:last-child {
    grid-column: 1 / -1;
}

.hero-content::after {
    content: "";
    position: absolute;
    inset: auto -4rem -5rem auto;
    width: 14rem;
    height: 14rem;
    background: radial-gradient(circle, rgba(186, 90, 49, 0.24), transparent 68%);
}

.hero-panel {
    display: flex;
}

.hero-panel-card {
    width: 100%;
    border-radius: var(--radius-xl);
    padding: 2rem;
    display: flex;
    align-items: flex-end;
    background:
        linear-gradient(180deg, rgba(40, 72, 63, 0.92), rgba(34, 27, 23, 0.92)),
        url("/static/assets/what_the_pug_bg.jpg") center/cover;
    color: #fff;
}

.hero-panel-card p,
.hero-panel-card li {
    color: rgba(255, 255, 255, 0.82);
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--accent);
    margin-bottom: 1rem;
}

.hero h1,
.page-hero h1,
.auth-copy h1 {
    font-size: clamp(2.8rem, 6vw, 5rem);
    line-height: 0.95;
    max-width: 11ch;
}

.hero-copy {
    margin-top: 1.25rem;
    max-width: 48rem;
    font-size: 1.08rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.9rem;
    margin-top: 2rem;
}

.hero-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 2.5rem;
}

.hero-metrics div {
    padding-top: 1rem;
    border-top: 1px solid var(--line);
}

.hero-metrics strong {
    display: block;
    font-size: 1.4rem;
    font-weight: 800;
}

.hero-metrics span {
    color: var(--muted);
    font-size: 0.92rem;
}

.highlight-list {
    padding-left: 1.1rem;
    margin: 0;
    display: grid;
    gap: 0.9rem;
}

.collection-intro,
.page-hero {
    padding: 1rem 0 1.4rem;
    display: flex;
    justify-content: space-between;
    gap: 2rem;
    align-items: end;
}

.collection-intro h2,
.cart-summary h2 {
    font-size: clamp(2rem, 4vw, 3rem);
}

.collection-intro > p {
    max-width: 32rem;
}

.products {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
    gap: 1.4rem;
    padding-top: 0.5rem;
    padding-bottom: 1rem;
}

.product-card {
    display: grid;
    background: rgba(255, 252, 247, 0.92);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.7);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    min-height: 100%;
    transform: translateY(16px);
    opacity: 0;
    animation: cardIn 0.7s ease forwards;
}

.product-card:nth-child(2) {
    animation-delay: 0.08s;
}

.product-card:nth-child(3) {
    animation-delay: 0.16s;
}

.product-card:nth-child(4) {
    animation-delay: 0.24s;
}

.product-card:hover {
    transform: translateY(-4px);
    transition: transform 0.24s ease, box-shadow 0.24s ease;
    box-shadow: 0 24px 56px rgba(61, 37, 16, 0.14);
}

.product-media {
    min-height: 290px;
    display: grid;
    place-items: center;
    padding: 1.6rem;
    background:
        radial-gradient(circle at top, rgba(186, 90, 49, 0.14), transparent 35%),
        linear-gradient(180deg, #fbf5ef 0%, #f3e7d9 100%);
}

.product-media-link {
    display: block;
    width: 100%;
    height: 100%;
}

.product-gallery {
    position: relative;
    width: 100%;
    height: 250px;
}

.product-media img,
.product-gallery-image {
    width: 100%;
    height: 250px;
    object-fit: contain;
}

.product-gallery-image {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 1.4s ease-in-out;
}

.product-gallery-image.is-active {
    opacity: 1;
}

.product-placeholder {
    display: grid;
    place-items: center;
    width: 100%;
    height: 250px;
    border-radius: var(--radius-md);
    background: rgba(34, 27, 23, 0.06);
    color: var(--muted);
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.product-placeholder.small {
    height: 96px;
}

.product-info {
    padding: 1.5rem;
    display: grid;
    gap: 1rem;
}

.product-heading {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: start;
}

.product-heading h3 {
    font-size: 1.35rem;
}

.product-price {
    white-space: nowrap;
    font-weight: 800;
    color: var(--ink);
}

.color-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.color-swatch {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1px solid rgba(34, 27, 23, 0.16);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.7);
}

.purchase-form,
.auth-form {
    display: grid;
    gap: 0.8rem;
}

label {
    font-size: 0.86rem;
    font-weight: 700;
    color: var(--muted);
}

select,
input {
    width: 100%;
    padding: 0.82rem 0.95rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line-strong);
    background: var(--surface-strong);
    color: var(--ink);
    font: inherit;
}

select:focus,
input:focus {
    outline: 2px solid rgba(186, 90, 49, 0.18);
    outline-offset: 2px;
    border-color: rgba(186, 90, 49, 0.45);
}

.purchase-row {
    display: grid;
    grid-template-columns: 92px 1fr;
    gap: 0.75rem;
    align-items: end;
}

.field-group {
    display: grid;
    gap: 0.45rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 50px;
    padding: 0.9rem 1.4rem;
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
    color: #fff;
    text-decoration: none;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 16px 30px rgba(186, 90, 49, 0.24);
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.btn:hover,
.btn:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 18px 34px rgba(186, 90, 49, 0.3);
    filter: saturate(1.05);
}

.btn-secondary {
    background: transparent;
    color: var(--ink);
    border: 1px solid var(--line-strong);
    box-shadow: none;
}

.btn-secondary:hover,
.btn-secondary:focus-visible {
    box-shadow: none;
    background: rgba(34, 27, 23, 0.04);
}

.add-btn,
.auth-submit,
.checkout-btn {
    width: 100%;
}

.page-hero,
.cart-summary,
.auth-card {
    padding: 2rem;
    border-radius: var(--radius-xl);
}

.page-hero.compact h1 {
    font-size: clamp(2.2rem, 4.5vw, 3.6rem);
    max-width: none;
}

.product-detail {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
    gap: 1.5rem;
    padding-top: 0.75rem;
}

.detail-gallery-shell,
.detail-copy,
.detail-meta-card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(255, 250, 244, 0.94));
    border: 1px solid rgba(255, 255, 255, 0.62);
    box-shadow: var(--shadow-md);
}

.detail-gallery-shell,
.detail-copy {
    border-radius: var(--radius-xl);
    padding: 1.4rem;
}

.detail-gallery {
    position: relative;
    min-height: 560px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background:
        radial-gradient(circle at top, rgba(186, 90, 49, 0.14), transparent 35%),
        linear-gradient(180deg, #fbf5ef 0%, #f3e7d9 100%);
}

.detail-gallery-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 2rem;
    opacity: 0;
    transition: opacity 0.35s ease;
}

.detail-gallery-image.is-active {
    opacity: 1;
}

.detail-thumbs {
    margin-top: 1rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
    gap: 0.75rem;
}

.detail-thumb {
    padding: 0;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}

.detail-thumb.is-active {
    border-color: rgba(186, 90, 49, 0.5);
}

.detail-thumb img {
    width: 100%;
    height: 80px;
    object-fit: cover;
}

.detail-copy {
    display: grid;
    align-content: start;
    gap: 1.2rem;
}

.detail-copy h1 {
    font-size: clamp(2.2rem, 4vw, 3.8rem);
    line-height: 0.95;
}

.detail-price {
    color: var(--ink);
    font-size: 1.45rem;
    font-weight: 800;
}

.detail-description p {
    font-size: 1rem;
    white-space: pre-line;
}

.detail-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.8rem;
}

.detail-meta-card {
    padding: 1rem;
    border-radius: var(--radius-lg);
}

.detail-meta-card span {
    display: block;
    margin-bottom: 0.4rem;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.detail-meta-card strong {
    display: block;
    color: var(--ink);
    font-size: 1rem;
}

.detail-purchase-form {
    margin-top: 0.25rem;
}

.detail-purchase-row {
    grid-template-columns: 110px 1fr;
}

.detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.related-products-wrap {
    padding-top: 2rem;
}

.section-heading {
    display: grid;
    gap: 0.35rem;
    padding-bottom: 1rem;
}

.section-heading h2 {
    font-size: clamp(1.8rem, 3.5vw, 2.6rem);
}

.cart-layout,
.auth-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.8fr);
    gap: 1.4rem;
    align-items: start;
    padding-top: 1rem;
}

.cart-items {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 1rem;
}

.cart-item {
    display: grid;
    grid-template-columns: 112px 1fr;
    gap: 1rem;
    padding: 1.1rem;
    background: rgba(255, 252, 247, 0.92);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.72);
    box-shadow: var(--shadow-sm);
}

.cart-media img {
    width: 112px;
    height: 112px;
    object-fit: cover;
    border-radius: var(--radius-md);
    background: var(--surface-solid);
}

.item-info {
    display: grid;
    gap: 0.9rem;
}

.item-heading {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: start;
}

.item-heading p {
    color: var(--ink);
    font-weight: 800;
}

.item-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.quantity-form {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.35rem;
    background: var(--surface-solid);
    border: 1px solid var(--line);
    border-radius: 999px;
}

.qty-btn,
.remove-btn {
    border: none;
    background: none;
    font: inherit;
    cursor: pointer;
}

.qty-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    font-weight: 800;
    color: var(--ink);
}

.qty-btn:hover,
.qty-btn:focus-visible {
    background: rgba(34, 27, 23, 0.06);
}

.qty {
    min-width: 2rem;
    text-align: center;
    font-weight: 800;
}

.remove-btn {
    padding: 0.7rem 1rem;
    border-radius: 999px;
    border: 1px solid var(--line-strong);
    color: var(--muted);
    font-weight: 700;
}

.remove-btn:hover,
.remove-btn:focus-visible {
    background: rgba(34, 27, 23, 0.04);
}

.cart-summary {
    position: sticky;
    top: 7rem;
}

.cart-summary p + .btn {
    margin-top: 1.4rem;
}

.auth-copy {
    padding: 1.5rem 0.5rem 0 0;
}

.auth-copy p:last-child {
    margin-top: 1rem;
    max-width: 32rem;
}

.empty-state {
    padding: 2rem;
    border-radius: var(--radius-lg);
    background: rgba(255, 252, 247, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.72);
    box-shadow: var(--shadow-sm);
    display: grid;
    gap: 0.9rem;
}

.site-footer {
    padding: 2.5rem 0 3rem;
}

.site-footer p {
    text-align: center;
    font-size: 0.92rem;
}

@keyframes cardIn {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 980px) {
    .hero,
    .product-detail,
    .cart-layout,
    .auth-layout,
    .collection-intro,
    .page-hero {
        grid-template-columns: 1fr;
        display: grid;
    }

    .collection-intro,
    .page-hero {
        gap: 1rem;
    }

    .cart-summary {
        position: static;
    }
}

@media (max-width: 760px) {
    .site-header {
        border-radius: 28px;
        padding: 1rem;
        justify-content: center;
    }

    .brand {
        width: 100%;
        justify-content: center;
    }

    .catalog-search {
        width: 100%;
        flex: 1 1 100%;
    }

    .site-nav {
        justify-content: center;
    }

    .hero {
        padding-top: 3rem;
    }

    .hero h1,
    .auth-copy h1 {
        max-width: none;
    }

    .hero-metrics,
    .purchase-row {
        grid-template-columns: 1fr;
    }

    .products {
        grid-template-columns: 1fr;
    }

    .product-heading,
    .item-heading {
        flex-direction: column;
    }

    .detail-gallery {
        min-height: 420px;
    }
}

@media (max-width: 640px) {
    .catalog-search {
        display: grid;
        grid-template-columns: 1fr auto;
    }
}

@media (max-width: 560px) {
    .site-header,
    .hero,
    .collection-intro,
    .products,
    .page-hero,
    .cart-layout,
    .auth-layout,
    .site-footer,
    .flash-stack {
        width: min(calc(100% - 1rem), var(--site-width));
    }

    .hero-content,
    .hero-panel-card,
    .page-hero,
    .cart-summary,
    .auth-card,
    .empty-state {
        padding: 1.3rem;
    }

    .cart-item {
        grid-template-columns: 1fr;
    }

    .cart-media img,
    .product-placeholder.small {
        width: 100%;
        height: auto;
        min-height: 112px;
    }

    .detail-gallery {
        min-height: 320px;
    }

    .detail-gallery-image {
        padding: 1rem;
    }
}
