/* ── Buttons ── */

.btn-primary {
    width: 100%;
    padding: 13px;
    background: var(--purple);
    color: #fff;
    border: 2px solid var(--purple-dark);
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    letter-spacing: 0.3px;
    transition: transform 0.06s, box-shadow 0.06s;
    text-decoration: none;
    text-align: center;
    display: block;
}

.btn-primary:active {
    transform: translate(2px, 2px);
    box-shadow: none;
}

.btn-primary:disabled {
    background: #9CA3AF;
    border-color: #6B7280;
    cursor: not-allowed;
    box-shadow: none;
}

.btn-secondary {
    width: 100%;
    padding: 11px;
    background: var(--surface);
    color: var(--purple);
    border: 2px solid var(--purple);
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 3px 3px 0 var(--purple-soft);
    letter-spacing: 0.3px;
    transition: transform 0.06s, box-shadow 0.06s;
    text-align: center;
    display: block;
    text-decoration: none;
}

.btn-secondary:active {
    transform: translate(2px, 2px);
    box-shadow: none;
}

/* ── Section label ── */

.section-label {
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--purple-dark);
    margin-bottom: 16px;
    padding: 7px 12px;
    border: 2px dashed var(--purple-soft);
    background: var(--purple-pale);
    display: inline-block;
}

/* ── Product grid ── */

.product-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

@media (min-width: 600px) {
    .product-grid {
        gap: 16px;
    }
}

/* ── Product card ── */

.product-card {
    position: relative;
    background: var(--surface);
    border: 2px solid var(--purple);
    box-shadow: var(--shadow-pixel);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.1s, box-shadow 0.1s;
}

.product-card:hover {
    transform: translate(-1px, -1px);
    box-shadow: 5px 5px 0 var(--purple-dark);
}

.product-img {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 52px;
    border-bottom: 2px solid var(--purple-soft);
    user-select: none;
    overflow: hidden;
}

.product-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 6px;
}

.product-body {
    padding: 10px 9px;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 6px;
}

.product-name {
    font-weight: 600;
    font-size: 13px;
    color: var(--purple-dark);
    line-height: 1.35;
}

.product-tag {
    font-weight: 500;
    font-size: 11px;
    color: var(--purple-soft);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.qty-selector {
    width: 100%;
    padding: 6px 28px 6px 8px;
    border: 2px solid var(--purple);
    background: var(--bg);
    color: var(--text);
    font-size: 13px;
    cursor: pointer;
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%237B2FBE' stroke-width='2' fill='none' stroke-linecap='square'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
}

.product-price {
    font-weight: 700;
    font-size: 17px;
    color: var(--purple);
    min-height: 24px;
}

.add-btn {
    width: 100%;
    padding: 9px 4px;
    background: var(--purple);
    color: #fff;
    border: 2px solid var(--purple-dark);
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 0.5px;
    cursor: pointer;
    box-shadow: 2px 2px 0 var(--purple-dark);
    margin-top: auto;
    transition: transform 0.06s, box-shadow 0.06s;
}

.add-btn:active {
    transform: translate(2px, 2px);
    box-shadow: none;
}

.add-btn:disabled {
    background: #9CA3AF;
    border-color: #6B7280;
    cursor: not-allowed;
    box-shadow: none;
}

/* ── Sold out / badges ── */

.sold-out-overlay {
    position: absolute;
    inset: 0;
    background: rgba(45, 10, 78, 0.62);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    pointer-events: none;
}

.sold-out-badge-stamp {
    background: #DC2626;
    color: #fff;
    font-family: 'Press Start 2P', cursive;
    font-size: 9px;
    padding: 7px 12px;
    letter-spacing: 1px;
    box-shadow: 3px 3px 0 #7f1d1d;
    transform: rotate(-8deg);
}

.product-card.is-sold-out,
.product-card.is-coming-soon {
    opacity: 0.75;
}

.product-card.is-sold-out:hover,
.product-card.is-coming-soon:hover {
    transform: none;
    box-shadow: var(--shadow-pixel);
}

.coming-soon-badge-stamp {
    background: #2563EB;
    color: #fff;
    font-family: 'Press Start 2P', cursive;
    font-size: 8px;
    padding: 7px 10px;
    letter-spacing: 0.5px;
    line-height: 1.6;
    text-align: center;
    box-shadow: 3px 3px 0 #1E3A8A;
    transform: rotate(-8deg);
}

.back-in-stock-badge {
    display: inline-block;
    background: #16A34A;
    color: #fff;
    font-weight: 700;
    font-size: 10px;
    padding: 2px 7px;
    letter-spacing: 0.5px;
    border: 2px solid #14532d;
    margin-top: 4px;
    animation: pulse-green 1.8s ease-in-out infinite;
}

.coming-soon-badge {
    display: inline-block;
    background: #2563EB;
    color: #fff;
    font-weight: 700;
    font-size: 10px;
    padding: 2px 7px;
    letter-spacing: 0.5px;
    border: 2px solid #1E3A8A;
    margin-top: 4px;
}

@keyframes pulse-green {
    0%, 100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.5); }
    50%       { box-shadow: 0 0 0 4px rgba(22, 163, 74, 0); }
}

/* ── Empty state ── */

.empty-state {
    text-align: center;
    padding: 48px 24px;
    border: 2px dashed var(--purple-soft);
    background: var(--purple-pale);
    color: var(--purple-dark);
}

.empty-state__icon {
    font-size: 36px;
    margin-bottom: 12px;
}

.empty-state__title {
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 8px;
}

.empty-state__text {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.65;
    max-width: 36ch;
    margin: 0 auto;
}

/* ── Info cards ── */

.info-card {
    background: var(--surface);
    border: 2px solid var(--purple-soft);
    box-shadow: 3px 3px 0 var(--purple-mid);
    padding: 20px;
    margin-bottom: 16px;
}

.info-card__title {
    font-family: 'Press Start 2P', cursive;
    font-size: 10px;
    color: var(--purple);
    line-height: 1.8;
    margin-bottom: 12px;
}

.info-card__body {
    font-size: 15px;
    color: var(--text);
    line-height: 1.65;
}

.info-card__body p + p {
    margin-top: 12px;
}

/* ── Contact CTA ── */

.contact-cta {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 16px;
    padding: 36px 24px;
    background: var(--surface);
    border: 3px solid var(--purple);
    box-shadow: var(--shadow-pixel);
}

.contact-cta__icon {
    font-size: 48px;
}

.contact-cta__title {
    font-family: 'Press Start 2P', cursive;
    font-size: 11px;
    color: var(--purple-dark);
    line-height: 1.8;
}

.contact-cta__text {
    font-size: 15px;
    color: var(--text-muted);
    max-width: 40ch;
    line-height: 1.6;
}

/* ── Modals ── */

.overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(20, 5, 45, 0.80);
    z-index: 400;
    padding:
        calc(16px + var(--safe-top))
        calc(16px + var(--safe-right))
        calc(16px + var(--safe-bottom))
        calc(16px + var(--safe-left));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.overlay.is-open {
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.modal {
    background: var(--surface);
    border: 3px solid var(--purple);
    box-shadow: 7px 7px 0 var(--purple-dark);
    width: 100%;
    max-width: 480px;
    max-height: calc(var(--app-height, 100dvh) - 32px - var(--safe-top) - var(--safe-bottom));
    margin: auto;
    overflow-y: auto;
    animation: modal-in 0.22s ease;
}

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

.modal-header {
    background: var(--purple);
    color: #fff;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 3px solid var(--purple-dark);
}

.modal-title {
    font-weight: 700;
    font-size: 16px;
    letter-spacing: 0.5px;
}

.modal-close {
    background: none;
    border: 2px solid rgba(255, 255, 255, 0.5);
    color: #fff;
    width: 30px;
    height: 30px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.modal-close:hover {
    border-color: #fff;
}

.modal-body {
    padding: 16px;
}

.modal-footer {
    padding: 14px 16px;
    border-top: 3px solid var(--purple);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ── Cart ── */

.cart-empty {
    text-align: center;
    font-weight: 600;
    font-size: 15px;
    color: var(--purple-soft);
    padding: 30px 20px;
    line-height: 2;
}

.cart-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 0;
    border-bottom: 1px solid var(--purple-mid);
}

.cart-item-thumb {
    width: 38px;
    height: 38px;
    background: #000;
    border: 2px solid var(--purple-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    overflow: hidden;
}

.cart-item-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-item-info {
    flex: 1;
    min-width: 0;
}

.cart-item-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--purple-dark);
    line-height: 1.3;
    margin-bottom: 2px;
    word-break: break-word;
}

.cart-item-qty {
    font-size: 13px;
    color: var(--text-muted);
}

.cart-item-price {
    font-weight: 700;
    font-size: 15px;
    color: var(--purple);
    flex-shrink: 0;
}

.cart-item-remove {
    background: none;
    border: 2px solid #DC2626;
    color: #DC2626;
    width: 28px;
    height: 28px;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-weight: 700;
}

.cart-item-remove:hover {
    background: #DC2626;
    color: #fff;
}

.cart-summary {
    margin-top: 14px;
    border-top: 2px solid var(--purple-mid);
    padding-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cart-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: var(--text-muted);
}

.cart-row.total {
    font-weight: 700;
    font-size: 17px;
    color: var(--text);
    border-top: 2px dashed var(--purple-soft);
    padding-top: 8px;
    margin-top: 4px;
}

.cart-row.total span:last-child {
    color: var(--purple);
}

.shipping-free {
    color: #16A34A;
    font-weight: 700;
}

.free-shipping-nudge {
    font-size: 12px;
    color: var(--purple-light);
    text-align: center;
    padding: 8px 12px;
    background: var(--purple-pale);
    border: 1px dashed var(--purple-soft);
    margin-top: 8px;
    font-weight: 500;
}

.cart-row.discount span:last-child {
    color: #16A34A;
}

/* ── Checkout fields ── */

.checkout-fields {
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.checkout-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.checkout-label {
    font-weight: 700;
    font-size: 13px;
    color: var(--purple-dark);
}

.checkout-select {
    width: 100%;
}

.courier-notice {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.5;
    margin: 6px 0 0;
}

/* ── Referral / promotion code ── */

.referral-box {
    margin-top: 14px;
    padding: 12px;
    background: var(--purple-pale);
    border: 2px dashed var(--purple-soft);
}

.referral-label {
    display: block;
    font-weight: 700;
    font-size: 13px;
    color: var(--purple-dark);
    margin-bottom: 8px;
}

.referral-row {
    display: flex;
    gap: 8px;
}

.referral-input {
    flex: 1;
    min-width: 0;
    padding: 8px 10px;
    border: 2px solid var(--purple);
    background: var(--surface);
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
    outline: none;
}

.referral-apply-btn {
    padding: 8px 14px;
    background: var(--purple);
    color: #fff;
    border: 2px solid var(--purple-dark);
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    box-shadow: 2px 2px 0 var(--purple-dark);
    flex-shrink: 0;
}

.referral-apply-btn:active {
    transform: translate(2px, 2px);
    box-shadow: none;
}

.referral-hint {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 8px;
    line-height: 1.5;
}

.referral-clear-btn {
    margin-top: 8px;
    background: none;
    border: none;
    color: var(--purple-light);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
}

/* ── Order message ── */

.order-explainer {
    background: var(--purple-pale);
    border: 2px dashed var(--purple-soft);
    padding: 12px 14px;
    font-size: 14px;
    line-height: 1.55;
    color: var(--purple-dark);
    margin-bottom: 14px;
}

.order-explainer strong {
    color: var(--purple);
}

.order-msg-box {
    background: var(--bg);
    border: 2px solid var(--purple-soft);
    padding: 14px;
    font-size: 14px;
    line-height: 1.6;
    white-space: pre-wrap;
    color: var(--text);
    max-height: 280px;
    overflow-y: auto;
    word-break: break-word;
}

/* ── Toast ── */

.toast {
    position: fixed;
    bottom: calc(24px + var(--safe-bottom));
    left: 50%;
    transform: translateX(-50%);
    background: var(--purple-dark);
    color: #fff;
    padding: 10px 18px;
    font-weight: 600;
    font-size: 13px;
    border: 2px solid var(--purple-soft);
    box-shadow: 3px 3px 0 var(--purple);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.25s;
    pointer-events: none;
    white-space: nowrap;
}

.toast.is-visible {
    opacity: 1;
}
