/* =========================================================
   Dezato feature screens - auth, account, builder, admin, browse
   ========================================================= */

/* Auth */
.auth-body {
    min-height: 100vh;
    background: var(--cream);
}

.auth-shell {
    width: min(100% - 2rem, 420px);
    margin: 0 auto;
    padding: 2.5rem 0 3rem;
}

.auth-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 1.5rem;
    font-family: var(--font-brand);
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--plum-600);
}

.auth-card {
    background: transparent;
    border-top: 1px solid var(--line);
    padding-top: 1.5rem;
}

.auth-card h1 {
    font-family: var(--font-brand);
    font-size: clamp(1.8rem, 4vw, 2.2rem);
    margin-bottom: 0.4rem;
}

.auth-lead,
.auth-switch,
.auth-foot {
    color: var(--muted);
    font-size: 0.95rem;
}

.auth-lead {
    margin-bottom: 1.25rem;
}

.auth-social {
    display: grid;
    gap: 0.65rem;
    margin-bottom: 1rem;
}

.auth-social__btn--google {
    border-color: #dadce0;
}

.auth-social__btn--facebook {
    border-color: #1877f2;
    color: #1877f2;
}

.auth-divider {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 0.75rem;
    margin: 1.1rem 0;
    color: var(--muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    height: 1px;
    background: var(--line);
}

.admin-details {
    margin-top: 0.75rem;
    padding-top: 0.65rem;
    border-top: 1px dashed var(--line);
}

.admin-details summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--plum-600, #5a2d45);
}

.admin-details .admin-steps {
    margin-top: 0.65rem;
}

.auth-form {
    display: grid;
    gap: 0.85rem;
}

.auth-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    font-size: 0.9rem;
}

.auth-row a,
.auth-switch a,
.auth-foot a {
    color: var(--plum-600);
    font-weight: 600;
}

.auth-switch {
    margin-top: 1.25rem;
    text-align: center;
}

.auth-foot {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.75rem;
}

.check-inline {
    display: inline-flex;
    align-items: flex-start;
    gap: 0.55rem;
    max-width: 100%;
    cursor: pointer;
    font-weight: 600;
    line-height: 1.4;
}

.check-inline span {
    min-width: 0;
}

/* Account */
.account-shell {
    padding: var(--section-y) 0;
}

.account-layout {
    display: grid;
    gap: 2rem;
}

.account-nav__eyebrow {
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 0.85rem;
}

.account-nav nav {
    display: grid;
    gap: 0.35rem;
}

.account-nav a {
    padding: 0.55rem 0;
    border-bottom: 1px solid transparent;
    color: var(--muted);
    font-weight: 500;
    width: fit-content;
}

.account-nav a.is-active,
.account-nav a:hover {
    color: var(--ink);
    border-bottom-color: var(--plum-600);
}

.account-nav__out {
    display: inline-block;
    margin-top: 1.5rem;
    font-size: 0.9rem;
    color: var(--muted);
}

.account-head {
    margin-bottom: 1.5rem;
}

.account-head h1 {
    font-family: var(--font-brand);
    font-size: clamp(1.8rem, 4vw, 2.4rem);
}

.account-head p {
    margin-top: 0.35rem;
    color: var(--muted);
}

.account-form {
    display: grid;
    gap: 1rem;
    max-width: 36rem;
}

.address-list,
.order-list {
    display: grid;
    gap: 1rem;
}

.address-card,
.order-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--line);
}

.address-card__label {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.address-card__label span {
    margin-left: 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--plum-600);
}

.address-card__actions,
.order-row__actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.order-row__actions a,
.order-row__actions button,
.address-card__actions button {
    font: inherit;
    background: none;
    border: 0;
    padding: 0;
    color: var(--plum-600);
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.order-row__id {
    font-family: var(--font-brand);
    font-size: 1.15rem;
}

.order-row__meta,
.order-row__items {
    color: var(--muted);
    font-size: 0.92rem;
    margin-top: 0.2rem;
}

.order-row__side {
    text-align: right;
}

.order-row__status {
    font-size: 0.85rem;
    font-weight: 600;
}

.order-row__total {
    margin: 0.25rem 0 0.5rem;
}

.address-add {
    margin-top: 1.5rem;
}

.address-add summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--plum-600);
    margin-bottom: 1rem;
}

.track-steps {
    display: grid;
    gap: 0.85rem;
    margin: 1.5rem 0 2rem;
}

.track-steps li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--muted);
}

.track-steps__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--line);
}

.track-steps .is-done,
.track-steps .is-current {
    color: var(--ink);
    font-weight: 600;
}

.track-steps .is-done .track-steps__dot,
.track-steps .is-current .track-steps__dot {
    background: var(--plum-600);
}

.track-map {
    border: 1px dashed var(--line);
    padding: 2.5rem 1.25rem;
    text-align: center;
    color: var(--muted);
    margin-bottom: 1.5rem;
}

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

@media (min-width: 860px) {
    .account-layout {
        grid-template-columns: 200px 1fr;
        gap: 3rem;
    }
}

/* Menu tools */
.menu-tools {
    display: grid;
    gap: 0.85rem;
    margin-bottom: 1.25rem;
}

.menu-tools__row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
}

.menu-search {
    position: relative;
}

.menu-search input {
    width: 100%;
    min-height: 48px;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    background: transparent;
    padding: 0 0.15rem;
    font: inherit;
}

.menu-sort select,
.menu-size select {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: transparent;
    padding: 0 0.75rem;
    font: inherit;
    color: var(--ink);
}

@media (min-width: 768px) {
    .menu-tools__row {
        grid-template-columns: 1fr 1fr;
        max-width: 28rem;
    }
}

/* Product badges restored (subtle) */
.product-card__badge {
    display: inline-block;
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 1;
    padding: 0.28rem 0.55rem;
    border-radius: var(--radius-sm);
    background: rgba(250, 246, 242, 0.94);
    color: var(--plum-700);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.product-card__urgency {
    display: inline-block;
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    z-index: 1;
    padding: 0.28rem 0.55rem;
    border-radius: var(--radius-sm);
    background: rgba(250, 246, 242, 0.94);
    color: var(--plum-700);
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.2;
}

/* Gallery */
.product-gallery {
    display: grid;
    gap: 0.65rem;
}

.product-gallery__main {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: var(--radius-md);
    background: var(--cream-deep);
}

.product-gallery__main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-gallery__thumbs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}

.product-gallery__thumbs button {
    aspect-ratio: 1;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    overflow: hidden;
    padding: 0;
    background: var(--cream-deep);
}

.product-gallery__thumbs button.is-active {
    border-color: var(--plum-600);
}

.product-gallery__thumbs img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.45rem;
    margin-bottom: 0.75rem;
    color: var(--muted);
    font-size: 0.82rem;
}

.breadcrumb a {
    color: var(--plum-600);
    font-weight: 600;
}

.product-facts {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.55rem;
    margin: 1.1rem 0 0;
}

.product-facts > div {
    padding: 0.7rem 0.8rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.62);
}

.product-facts dt {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

.product-facts dd {
    margin: 0.2rem 0 0;
    color: var(--ink);
    font-weight: 600;
}

.product-notes {
    display: grid;
    gap: 0.65rem;
    margin-top: 1.35rem;
}

.product-notes h2 {
    font-family: var(--font-brand);
    font-size: 1.2rem;
}

.product-notes p,
.product-notes a {
    color: var(--muted);
    line-height: 1.55;
}

.product-notes a {
    color: var(--plum-600);
    font-weight: 600;
}

.product-buybar,
.product-buybar-spacer {
    display: none;
}

@media (min-width: 480px) {
    .product-facts {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 959px) {
    .product-buybar {
        position: fixed;
        z-index: 45;
        left: 0;
        right: 0;
        bottom: calc(var(--bottom-bar-h) + var(--safe-b));
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.75rem;
        padding: 0.65rem 1rem;
        background: rgba(250, 246, 242, 0.97);
        border-top: 1px solid var(--line);
    }

    .product-buybar strong {
        font-family: var(--font-brand);
        font-size: 1.15rem;
    }

    .product-buybar .btn {
        min-height: 44px;
        flex: 0 1 auto;
    }

    .product-buybar-spacer {
        display: block;
        height: 4.25rem;
    }
}

/* Builder */
.builder-head {
    max-width: 40rem;
    margin-bottom: 2rem;
}

.builder-head h1 {
    font-family: var(--font-brand);
    font-size: clamp(2rem, 5vw, 3rem);
}

.builder-head p {
    margin-top: 0.5rem;
    color: var(--muted);
}

.builder-layout {
    display: grid;
    gap: 2rem;
}

.builder-block {
    padding: 1.5rem 0;
    border-top: 1px solid var(--line);
}

.builder-block h2 {
    font-family: var(--font-brand);
    font-size: 1.35rem;
    margin-bottom: 1rem;
}

.option-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
}

.option-grid--compact {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.option-tile,
.check-tile {
    display: block;
    cursor: pointer;
}

.check-tile--block {
    margin-bottom: 0.65rem;
}

.check-tile--block span {
    display: grid;
    gap: 0.25rem;
}

.check-tile--block strong {
    font-weight: 600;
}

.check-tile--block small {
    color: var(--muted);
    font-size: 0.85rem;
}

.builder-guidelines {
    margin: 0 0 1.5rem;
    padding: 1.1rem 1.25rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--cream-deep, #f3ebe4);
}

.builder-guidelines h2 {
    font-family: var(--font-brand);
    font-size: 1.2rem;
    margin: 0 0 0.65rem;
}

.builder-guidelines ul,
.builder-guidelines--page {
    margin: 0;
    padding-left: 1.15rem;
    display: grid;
    gap: 0.45rem;
    color: var(--ink);
}

.builder-guidelines--page {
    max-width: 42rem;
}

.addon-list {
    display: grid;
    gap: 0.65rem;
}

.addon-qty {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.75rem;
    align-items: center;
    padding: 0.85rem 0.9rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
}

.addon-qty__copy {
    display: grid;
    gap: 0.15rem;
}

.addon-qty__copy span {
    color: var(--muted);
    font-size: 0.9rem;
}

.addon-qty__copy small {
    color: var(--muted);
    font-size: 0.85rem;
}

.addon-qty__field input {
    width: 4.5rem;
    padding: 0.55rem 0.5rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    font: inherit;
    text-align: center;
}

.option-tile input,
.check-tile input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.option-tile span,
.check-tile span {
    display: grid;
    gap: 0.2rem;
    padding: 0.85rem 0.9rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    min-height: 100%;
}

.option-tile input:checked + span,
.check-tile input:checked + span {
    border-color: var(--plum-600);
    background: var(--cream-deep);
}

.option-tile strong {
    font-family: var(--font-brand);
}

.option-tile small,
.option-tile em,
.check-tile em {
    color: var(--muted);
    font-style: normal;
    font-size: 0.85rem;
}

.check-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.65rem;
}

@media (min-width: 480px) {
    .check-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.color-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.55rem;
}

.color-swatch {
    position: relative;
    display: block;
    cursor: pointer;
}

.color-swatch > input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.color-swatch > span {
    display: block;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--swatch);
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px var(--line);
}

.color-swatch > input[type="radio"]:checked + span,
.color-swatch > input[type="radio"]:focus-visible + span {
    box-shadow: 0 0 0 2px var(--plum-600);
}

.color-swatch--custom > span {
    position: relative;
    overflow: hidden;
    background: linear-gradient(
        135deg,
        #f7f1e8 0%,
        #e8d0dc 35%,
        #c45c6a 70%,
        #4a3428 100%
    );
}

.color-swatch--custom.is-active > span {
    background: var(--swatch);
}

.color-swatch--custom > span::after {
    content: "+";
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 1px 2px rgba(36, 24, 32, 0.45);
    pointer-events: none;
    z-index: 1;
}

.color-swatch--custom.is-active > span::after {
    content: "";
}

.color-swatch__custom input[type="color"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    border-radius: 50%;
    opacity: 0;
    cursor: pointer;
}

.color-hint {
    margin: 0.55rem 0 0;
    font-size: 0.85rem;
    color: var(--muted);
}

.upload-zone {
    display: grid;
    place-items: center;
    min-height: 140px;
    border: 1px dashed var(--line);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    text-align: center;
    color: var(--muted);
    cursor: pointer;
}

.upload-zone input {
    display: none;
}

.upload-preview {
    margin-top: 0.85rem;
}

.upload-preview img {
    width: min(100%, 280px);
    border-radius: var(--radius-md);
}

.builder-summary {
    position: sticky;
    top: calc(var(--header-h) + 1rem);
    align-self: start;
    padding: 1.25rem 0;
    border-top: 1px solid var(--line);
}

.builder-summary h2 {
    font-family: var(--font-brand);
    margin-bottom: 1rem;
}

.builder-totals {
    display: grid;
    gap: 0.55rem;
    margin-bottom: 1rem;
}

.builder-totals > div {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.builder-totals__total {
    padding-top: 0.55rem;
    border-top: 1px solid var(--line);
    font-weight: 700;
}

.builder-note {
    color: var(--muted);
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.builder-summary .btn + .btn {
    margin-top: 0.55rem;
}

@media (min-width: 960px) {
    .builder-layout {
        grid-template-columns: 1fr 280px;
        gap: 3rem;
    }

    .option-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .check-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

/* Checkout extras */
.checkout-extras {
    display: grid;
    gap: 1.25rem;
    margin-top: 1.25rem;
}

.pay-option small {
    display: block;
    color: var(--muted);
    margin-top: 0.15rem;
}

.upsell-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
    margin-top: 1rem;
}

@media (min-width: 768px) {
    .upsell-row {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.flash--success {
    background: rgba(46, 125, 50, 0.1);
    border: 1px solid rgba(46, 125, 50, 0.25);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
}

.flash--error {
    background: rgba(183, 28, 28, 0.08);
    border: 1px solid rgba(183, 28, 28, 0.25);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
}

.flash--error ul {
    margin: 0.35rem 0 0;
    padding-left: 1.1rem;
}

.text-btn--danger {
    color: #b71c1c;
}

.btn--sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.85rem;
}

.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;
}

.account-nav__out {
    display: inline-block;
    margin-top: 1rem;
    background: none;
    border: 0;
    padding: 0;
    font: inherit;
    color: var(--muted);
    cursor: pointer;
    text-decoration: underline;
}

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

.pager__btn {
    padding: 0.4rem 0.75rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fff;
}

.pager__btn.is-disabled {
    opacity: 0.45;
    pointer-events: none;
}

.pager__status {
    color: var(--muted);
    font-size: 0.88rem;
}

.menu-count {
    margin: 0 0 1rem;
    color: var(--muted);
    font-size: 0.92rem;
}

.menu-more {
    display: grid;
    justify-items: center;
    gap: 0.35rem;
    margin-top: 1.75rem;
}

.menu-more__btn {
    min-width: min(100%, 16rem);
}

.menu-more__page-link {
    font-size: 0.86rem;
    color: var(--plum-600);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.menu-more__sentinel {
    width: 1px;
    height: 1px;
    pointer-events: none;
}

.menu-pager {
    margin-top: 1.25rem;
}

.menu-pager .pager {
    justify-content: center;
}

.admin-price-row {
    display: grid;
    gap: 0.65rem;
    margin-bottom: 0.85rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--line);
}

@media (min-width: 720px) {
    .admin-price-row {
        grid-template-columns: 1.4fr 1fr 1fr;
        align-items: end;
    }
}

.admin-pay-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.85rem;
}

.admin-pay-list li {
    padding: 0.75rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.45);
}

.admin-slide-card {
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 1rem;
    background: rgba(255, 255, 255, 0.45);
}

.admin-slide-card__preview {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 0.85rem;
}

.admin-slide-card__preview img {
    width: 120px;
    height: 75px;
    object-fit: cover;
    border-radius: 8px;
}

.pay-instructions {
    margin: 0.35rem 0 1rem;
    padding: 0.85rem 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fff8f0;
}

.pay-instructions ul {
    margin: 0.4rem 0;
    padding-left: 1.1rem;
}

.pay-instructions li span {
    color: var(--muted);
}

.pay-instructions--confirm {
    margin: 1rem 0;
}

.legal-page {
    max-width: 42rem;
    margin-inline: auto;
}

.legal-prose {
    display: grid;
    gap: 0.85rem;
}

.legal-prose p {
    margin: 0;
    line-height: 1.7;
    color: var(--ink, #2a1f24);
}

.legal-prose p strong {
    display: block;
    margin-bottom: 0.2rem;
    color: var(--plum-700, #5a2d45);
}
