:root {
    --pink: #df286d;
    --pink-dark: #b71958;
    --pink-soft: #fff0f6;
    --purple: #54284a;
    --green: #169b52;
    --green-soft: #eaf8f0;
    --blue-soft: #edf5ff;
    --text: #332a32;
    --muted: #716670;
    --line: #eadfe7;
    --surface: #ffffff;
    --background: #fbf7fa;
    --shadow: 0 10px 28px rgba(67, 37, 60, 0.08);
}

* {
    box-sizing: border-box;
}

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

body {
    margin: 0;
    color: var(--text);
    background:
        radial-gradient(circle at 5% 0, #ffe4ef 0, #ffe4ef 10rem, transparent 10.2rem),
        var(--background);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

.site-header,
main,
.site-footer {
    width: min(100% - 1.5rem, 780px);
    margin-inline: auto;
}

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-block: 1.25rem 1rem;
}

.eyebrow {
    margin: 0 0 0.3rem;
    color: var(--pink);
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.11em;
    text-transform: uppercase;
}

h1,
h2,
h3,
p {
    overflow-wrap: anywhere;
}

h1 {
    margin: 0;
    color: var(--pink);
    font-size: clamp(1.55rem, 7vw, 2.3rem);
    line-height: 1;
}

.tagline {
    margin: 0.35rem 0 0;
    color: var(--muted);
    font-size: 0.92rem;
}

.shop-number {
    flex: 0 0 auto;
    padding: 0.7rem 0.85rem;
    border-radius: 1rem;
    color: white;
    background: var(--green);
    box-shadow: 0 8px 20px rgba(22, 155, 82, 0.2);
    font-size: 0.82rem;
    font-weight: 900;
    line-height: 1.25;
    text-align: center;
    text-decoration: none;
}

main {
    padding-bottom: 7rem;
}

.intro-card,
.customer-card,
.toolbar,
.category {
    margin-bottom: 1rem;
    border: 1px solid var(--line);
    border-radius: 1.35rem;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: var(--shadow);
}

.intro-card,
.customer-card {
    padding: 1.15rem;
}

.intro-card h2,
.customer-card h2 {
    margin: 0;
    color: var(--purple);
}

.intro-card ol {
    margin: 0.85rem 0;
    padding-left: 1.35rem;
}

.intro-card li + li {
    margin-top: 0.45rem;
}

.intro-card p {
    margin: 0;
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.45;
}

.customer-card {
    display: grid;
    gap: 1rem;
}

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

label {
    display: grid;
    gap: 0.4rem;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
}

input {
    width: 100%;
    min-height: 3rem;
    border: 1.5px solid #d8cad4;
    border-radius: 0.85rem;
    padding: 0.75rem 0.85rem;
    color: var(--text);
    background: white;
    outline: none;
}

input:focus {
    border-color: var(--pink);
    box-shadow: 0 0 0 3px rgba(223, 40, 109, 0.11);
}

.full-field {
    grid-column: 1 / -1;
}

.toolbar {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: end;
    gap: 0.85rem;
    padding: 0.85rem;
}

.search span {
    padding-left: 0.15rem;
}

.progress-card {
    min-width: 6.5rem;
    padding: 0.72rem 0.85rem;
    border-radius: 0.9rem;
    color: white;
    background: var(--purple);
    text-align: center;
}

.progress-card strong {
    display: block;
    font-size: 1.25rem;
}

.progress-card span {
    font-size: 0.72rem;
}

.category-nav {
    display: flex;
    gap: 0.55rem;
    overflow-x: auto;
    margin: 0 0 1rem;
    padding: 0.2rem 0 0.65rem;
    scrollbar-width: thin;
}

.category-nav a {
    flex: 0 0 auto;
    padding: 0.65rem 0.8rem;
    border: 1px solid #efcada;
    border-radius: 999px;
    color: var(--purple);
    background: white;
    font-size: 0.78rem;
    font-weight: 850;
    text-decoration: none;
}

.category {
    overflow: hidden;
}

.category-heading {
    padding: 1rem 1.05rem;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(135deg, #fff8fb, var(--pink-soft));
}

.category-heading span {
    color: var(--pink);
    font-size: 0.7rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.category-heading h2 {
    margin: 0.2rem 0 0;
    color: var(--purple);
    font-size: 1.35rem;
}

.category-heading p {
    margin: 0.5rem 0 0;
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.4;
}

.product-list {
    display: grid;
}

.product {
    display: grid;
    grid-template-columns: minmax(7.2rem, 36%) 1fr;
    min-height: 12rem;
    border-bottom: 1px solid var(--line);
    background: white;
}

.product:last-child {
    border-bottom: 0;
}

.product.saving {
    pointer-events: none;
    opacity: 0.7;
}

.product[hidden] {
    display: none;
}

.product > img {
    width: 100%;
    height: 100%;
    min-height: 12rem;
    padding: 0.7rem;
    object-fit: contain;
    background: #fff;
}

.product-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 0.9rem 0.9rem 0.9rem 0.45rem;
}

.code {
    align-self: flex-start;
    padding: 0.25rem 0.48rem;
    border-radius: 0.42rem;
    color: white;
    background: var(--purple);
    font-size: 0.66rem;
    font-weight: 900;
    letter-spacing: 0.04em;
}

.product h3 {
    margin: 0.5rem 0 0.35rem;
    font-size: 1.05rem;
    line-height: 1.2;
}

.price-line {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.5rem;
}

.price-line strong {
    color: var(--pink);
    font-size: 1.25rem;
}

.price-line del {
    color: #978c94;
    font-size: 0.78rem;
    font-weight: 750;
}

.choice-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.45rem;
    margin-top: auto;
    padding-top: 0.75rem;
}

.choice,
.sticky-summary button,
.dialog-actions button,
.close-dialog {
    border: 0;
    cursor: pointer;
}

.choice {
    min-height: 2.7rem;
    border: 2px solid #ddced9;
    border-radius: 0.75rem;
    color: #5e515b;
    background: #fbf9fa;
    font-size: 0.78rem;
    font-weight: 900;
    text-transform: uppercase;
}

.choice.have.active {
    border-color: var(--green);
    color: #0b6c37;
    background: var(--green-soft);
}

.choice.need.active {
    border-color: var(--pink);
    color: var(--pink-dark);
    background: var(--pink-soft);
}

.empty-search {
    margin-bottom: 1rem;
    padding: 2rem;
    border: 1px dashed #d6c4d1;
    border-radius: 1rem;
    color: var(--muted);
    background: white;
    text-align: center;
}

.sticky-summary {
    position: fixed;
    z-index: 20;
    right: 0;
    bottom: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem max(0.9rem, env(safe-area-inset-right)) calc(0.75rem + env(safe-area-inset-bottom)) max(0.9rem, env(safe-area-inset-left));
    color: white;
    background: rgba(84, 40, 74, 0.97);
    box-shadow: 0 -8px 24px rgba(49, 27, 44, 0.2);
    backdrop-filter: blur(12px);
}

.sticky-summary > div {
    display: flex;
    gap: 0.9rem;
    font-size: 0.78rem;
}

.sticky-summary strong {
    font-size: 1rem;
}

.sticky-summary button,
.whatsapp-button {
    min-height: 3rem;
    border-radius: 0.85rem;
    padding: 0.7rem 1rem;
    color: white;
    background: var(--green);
    font-weight: 900;
}

.sticky-summary button:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

dialog {
    width: min(100% - 1rem, 680px);
    max-height: calc(100dvh - 1rem);
    border: 0;
    border-radius: 1.25rem;
    padding: 0;
    color: var(--text);
    background: white;
    box-shadow: 0 24px 70px rgba(31, 15, 27, 0.35);
}

dialog::backdrop {
    background: rgba(35, 20, 31, 0.68);
    backdrop-filter: blur(3px);
}

.dialog-shell {
    display: grid;
    max-height: calc(100dvh - 1rem);
    grid-template-rows: auto 1fr auto;
}

.dialog-shell > header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid var(--line);
}

.dialog-shell h2 {
    margin: 0;
    color: var(--purple);
}

.close-dialog {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    color: var(--purple);
    background: var(--pink-soft);
    font-size: 1.5rem;
}

.review-content {
    overflow-y: auto;
    padding: 1rem;
}

.review-section + .review-section {
    margin-top: 1rem;
}

.review-section h3 {
    margin: 0 0 0.5rem;
    color: var(--purple);
}

.review-section ul {
    display: grid;
    gap: 0.45rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.review-section li {
    padding: 0.7rem 0.8rem;
    border-radius: 0.75rem;
    background: var(--background);
    font-size: 0.85rem;
}

.review-empty {
    color: var(--muted);
    font-style: italic;
}

.dialog-actions {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.7rem;
    padding: 1rem;
    border-top: 1px solid var(--line);
}

.dialog-actions button {
    min-height: 3rem;
    border-radius: 0.8rem;
    padding: 0.7rem 0.9rem;
    font-weight: 900;
}

.dialog-actions .secondary {
    color: var(--purple);
    background: var(--pink-soft);
}

.site-footer {
    display: grid;
    gap: 0.2rem;
    padding: 1.5rem 0 7rem;
    color: var(--muted);
    font-size: 0.8rem;
    text-align: center;
}

@media (min-width: 680px) {
    .customer-card {
        grid-template-columns: 0.85fr 2fr;
        align-items: start;
    }

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

    .category-heading p {
        max-width: 23rem;
        margin: 0;
        text-align: right;
    }

    .product {
        grid-template-columns: 15rem 1fr;
    }

    .product h3 {
        font-size: 1.25rem;
    }
}

@media (max-width: 480px) {
    .site-header,
    main,
    .site-footer {
        width: min(100% - 1rem, 780px);
    }

    .site-header {
        align-items: flex-start;
    }

    .tagline {
        max-width: 13rem;
    }

    .customer-fields {
        grid-template-columns: 1fr;
    }

    .full-field {
        grid-column: auto;
    }

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

    .progress-card {
        display: flex;
        align-items: baseline;
        justify-content: center;
        gap: 0.35rem;
    }

    .product {
        grid-template-columns: 42% 58%;
    }

    .product > img {
        padding: 0.45rem;
    }

    .product-info {
        padding: 0.75rem 0.65rem 0.75rem 0.25rem;
    }

    .product h3 {
        font-size: 0.94rem;
    }

    .price-line strong {
        font-size: 1.12rem;
    }

    .choice {
        min-height: 2.55rem;
        font-size: 0.7rem;
    }

    .sticky-summary > div {
        display: grid;
        gap: 0.05rem;
    }

    .dialog-actions {
        grid-template-columns: 1fr;
    }
}

.admin-page {
    min-height: 100vh;
}

.admin-header {
    padding-bottom: 1.3rem;
}

.admin-logout,
.primary-button,
.created-actions button,
.customer-actions button {
    border: 0;
    cursor: pointer;
    font: inherit;
    font-weight: 850;
}

.admin-logout {
    min-height: 2.7rem;
    border-radius: 0.8rem;
    padding: 0.65rem 0.85rem;
    color: var(--purple);
    background: var(--pink-soft);
}

.admin-main {
    width: min(100% - 1.5rem, 960px);
    padding-bottom: 3rem;
}

.admin-card,
.created-card {
    margin-bottom: 1rem;
    border: 1px solid var(--line);
    border-radius: 1.3rem;
    padding: 1.1rem;
    background: white;
    box-shadow: var(--shadow);
}

.admin-card h2,
.created-card h2 {
    margin: 0;
    color: var(--purple);
}

.admin-card > p,
.created-card p {
    color: var(--muted);
}

.narrow-card {
    max-width: 34rem;
    margin: 2rem auto;
}

.admin-form {
    display: grid;
    gap: 0.85rem;
    margin-top: 1rem;
}

.remember-option {
    display: flex;
    grid-template-columns: none;
    align-items: center;
    gap: 0.6rem;
    color: var(--text);
    font-size: 0.85rem;
}

.remember-option input {
    width: 1.15rem;
    min-height: 1.15rem;
    margin: 0;
    accent-color: var(--pink);
}

.primary-button {
    min-height: 3rem;
    border-radius: 0.85rem;
    padding: 0.75rem 1rem;
    color: white;
    background: var(--pink);
}

.alert {
    margin-bottom: 1rem;
    border-radius: 0.9rem;
    padding: 0.85rem 1rem;
    font-weight: 750;
}

.alert.error {
    color: #8b173f;
    background: #ffe8f0;
}

.alert.success {
    color: #0b6c37;
    background: var(--green-soft);
}

.create-customer-form {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    align-items: end;
    gap: 0.8rem;
    margin-top: 1rem;
}

.create-customer-form label strong {
    color: var(--pink);
}

.create-customer-form label span {
    font-weight: 600;
}

.created-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border-color: #bde8ce;
    background: var(--green-soft);
}

.created-actions,
.customer-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.created-actions a,
.created-actions button,
.customer-actions a,
.customer-actions button {
    min-height: 2.6rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.75rem;
    padding: 0.65rem 0.8rem;
    text-decoration: none;
}

.created-actions .secondary,
.customer-actions button,
.customer-actions a {
    color: var(--purple);
    background: white;
}

.admin-section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 0.9rem;
    border-bottom: 1px solid var(--line);
}

.admin-section-heading > strong {
    color: var(--muted);
    font-size: 0.85rem;
}

.customer-list {
    display: grid;
}

.customer-row {
    display: grid;
    grid-template-columns: minmax(10rem, 1fr) minmax(9rem, 0.8fr) auto;
    align-items: center;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--line);
}

.customer-row:last-child {
    border-bottom: 0;
}

.customer-row h3 {
    margin: 0.4rem 0 0;
}

.customer-row p {
    margin: 0.2rem 0 0;
    color: var(--muted);
    font-size: 0.82rem;
}

.status {
    display: inline-block;
    border-radius: 999px;
    padding: 0.25rem 0.5rem;
    font-size: 0.65rem;
    font-weight: 900;
    text-transform: uppercase;
}

.status-new {
    color: #5c5261;
    background: #eee8ed;
}

.status-in_progress {
    color: #875005;
    background: #fff1cc;
}

.status-completed {
    color: #0b6c37;
    background: var(--green-soft);
}

.customer-progress {
    display: grid;
    gap: 0.2rem;
    color: var(--muted);
    font-size: 0.78rem;
}

.customer-progress strong {
    color: var(--purple);
    font-size: 0.95rem;
}

.customer-progress small {
    color: #948891;
}

.customer-actions a,
.customer-actions button {
    border: 1px solid var(--line);
    font-size: 0.76rem;
}

.customer-actions .share-small {
    color: white;
    background: var(--green);
}

.admin-empty {
    padding: 2rem 0;
    text-align: center;
}

@media (max-width: 720px) {
    .create-customer-form {
        grid-template-columns: 1fr;
    }

    .created-card {
        align-items: flex-start;
        flex-direction: column;
    }

    .customer-row {
        grid-template-columns: 1fr;
    }

    .customer-progress {
        grid-template-columns: auto auto;
    }

    .customer-progress small {
        grid-column: 1 / -1;
    }
}
