.shop-page {
    min-height: 100vh;
    background: var(--tb-bg);
    color: var(--tb-text);
}

.shop-detail {
    padding-top: 8rem;
}

.shop-catalog {
    padding-top: 7rem;
    padding-bottom: 3.5rem;
}

.shop-catalog__heading {
    max-width: 48rem;
    margin-inline: auto;
    margin-bottom: 2rem;
}

.shop-product-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    max-width: 71.25rem;
    margin-inline: auto;
}

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

@media (min-width: 1024px) {
    .shop-product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.shop-empty,
.shop-gallery,
.shop-detail__content {
    background: var(--tb-surface);
    border: 1px solid var(--landing-border);
    border-radius: 24px;
    box-shadow: var(--landing-shadow);
}

/* ───────── Catalog product card (whole card = one link) ───────── */

.shop-card {
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--tb-surface);
    border: 1px solid var(--tb-border);
    border-radius: 16px;
    transition: box-shadow 150ms ease, transform 150ms ease;
}

.shop-card:hover {
    box-shadow: var(--landing-shadow);
    transform: translateY(-2px);
}

.shop-card__media {
    display: flex;
    aspect-ratio: 1 / 1;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: var(--tb-bg-soft);
}

.shop-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.shop-card__placeholder {
    color: var(--tb-primary);
    font-size: 4rem;
}

.shop-card__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1.25rem;
}

.shop-card__title {
    margin: 0;
    font-size: 1.15rem;
    line-height: 1.35;
    font-weight: 700;
}

.shop-card__link {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    color: var(--tb-text);
}

/* Stretched link: makes the whole card clickable without nesting controls. */
.shop-card__link::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 16px;
}

.shop-page .shop-card__link:focus-visible {
    outline: none;
}

.shop-page .shop-card__link:focus-visible::after {
    outline: 2px solid var(--tb-primary);
    outline-offset: 2px;
}

.shop-card__spec {
    margin: 0;
    color: var(--tb-text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
}

.shop-card__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.shop-card__badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.7rem;
    border: 1px solid var(--tb-border);
    border-radius: 999px;
    background: var(--tb-bg);
    color: var(--tb-primary);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: capitalize;
}

.shop-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: auto;
}

.shop-card__price {
    color: var(--tb-text);
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* ───────── Shop CTA button ───────── */

.shop-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 44px;
    padding: 10px 20px;
    border: 0;
    border-radius: 10px;
    background: var(--tb-accent);
    color: var(--tb-dark);
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.2;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(242, 164, 85, 0.3);
    cursor: pointer;
    transition: background 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.shop-btn--lg {
    padding: 14px 24px;
    font-size: 1rem;
}

.shop-btn--outline {
    background: var(--tb-surface);
    border: 1.5px solid var(--tb-border);
    color: var(--tb-text);
    box-shadow: none;
}

.shop-btn--outline:hover,
.shop-btn--outline:focus-visible {
    background: var(--tb-bg-soft);
    border-color: var(--tb-primary);
    color: var(--tb-primary);
    box-shadow: none;
}

.shop-btn:hover,
.shop-btn:focus-visible,
.shop-card:hover .shop-btn {
    background: var(--tb-accent-hover);
    box-shadow: 0 6px 16px rgba(242, 164, 85, 0.4);
}

/* ───────── Order confirmation (success page) ───────── */

.shop-success__heading {
    margin-bottom: 2.25rem;
}

.shop-success__icon {
    display: block;
    margin-bottom: 0.9rem;
    color: var(--tb-secondary);
    font-size: 3rem;
    line-height: 1;
}

.shop-success__card {
    max-width: 40rem;
    margin: 0 auto;
    padding: 2rem;
    background: var(--tb-surface);
    border: 1px solid var(--landing-border);
    border-radius: 24px;
    box-shadow: var(--landing-shadow);
}

.shop-success__summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--tb-border);
}

.shop-success__fact {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 0;
}

.shop-success__fact-label {
    color: var(--tb-text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.shop-success__fact-value {
    color: var(--tb-text);
    font-size: 1.05rem;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.shop-success__fact-value--total {
    color: var(--tb-primary);
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    white-space: nowrap;
}

.shop-success__items {
    padding: 1.25rem 0;
    border-bottom: 1px solid var(--tb-border);
}

.shop-success__items-title {
    margin: 0 0 0.75rem;
    color: var(--tb-text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.shop-success__items-list {
    display: grid;
    gap: 0.6rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.shop-success__items-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    color: var(--tb-text);
    font-size: 0.95rem;
    line-height: 1.55;
}

.shop-success__items-list i {
    margin-top: 0.25rem;
    color: var(--tb-secondary);
}

.shop-success__shipping-note {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    margin: 1.25rem 0 0;
    color: var(--tb-text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
}

.shop-success__shipping-note i {
    margin-top: 0.2rem;
    color: var(--tb-primary);
}

.shop-success__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

@media (max-width: 600px) {
    .shop-success__card {
        padding: 1.25rem;
    }

    .shop-success__summary {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .shop-success__actions {
        flex-direction: column;
    }

    .shop-success__actions .shop-btn {
        width: 100%;
    }
}

/* ───────── Why TidyBox ───────── */

.shop-why__list {
    display: grid;
    gap: 0.9rem;
    max-width: 46rem;
    margin: 0 auto;
    padding: 0;
    list-style: none;
}

@media (min-width: 640px) {
    .shop-why__list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        max-width: 60rem;
    }
}

.shop-why__item {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 1rem 1.25rem;
    background: var(--tb-surface);
    border: 1px solid var(--landing-border);
    border-radius: 16px;
    box-shadow: var(--landing-shadow);
    color: var(--tb-text);
    line-height: 1.55;
}

.shop-why__item i {
    margin-top: 0.25rem;
    color: var(--tb-secondary);
}

.shop-price {
    color: var(--tb-primary);
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.shop-empty {
    max-width: 36rem;
    margin: 0 auto;
    padding: 3rem;
    text-align: center;
}

.shop-empty > i {
    color: var(--tb-primary);
    font-size: 3rem;
}

.shop-empty h2 {
    margin: 1rem 0 0.5rem;
}

.shop-empty p {
    margin: 0;
    color: var(--tb-text-muted);
}

.shop-detail__header {
    margin-bottom: 1.75rem;
}

/* Title spans the full width; gallery + description/specs fill the left
   column, the purchase card sits alone in the right one. */
.shop-detail__grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(20rem, 0.85fr);
    grid-template-areas:
        "media buy"
        "info  buy";
    gap: 2rem;
    align-items: start;
}

.shop-detail__grid > .shop-gallery {
    grid-area: media;
}

.shop-detail__info {
    grid-area: info;
    background: var(--tb-surface);
    border: 1px solid var(--landing-border);
    border-radius: 24px;
    box-shadow: var(--landing-shadow);
    padding: 1.5rem;
}

.shop-detail__content {
    grid-area: buy;
    align-self: start;
}

.shop-gallery,
.shop-detail__content {
    padding: 1.25rem;
}

.shop-gallery__stage {
    position: relative;
    overflow: hidden;
    border-radius: 18px;
    background: var(--tb-bg-soft);
}

.shop-gallery__open {
    display: flex;
    width: 100%;
    aspect-ratio: 4 / 3;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: zoom-in;
}

.shop-gallery__open img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.shop-gallery__arrow,
.shop-gallery__lightbox-arrow,
.shop-gallery__lightbox-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    background: var(--tb-surface);
    color: var(--tb-primary);
    box-shadow: var(--landing-shadow);
    cursor: pointer;
}

.shop-gallery__arrow {
    position: absolute;
    top: 50%;
    width: 2.75rem;
    height: 2.75rem;
    transform: translateY(-50%);
}

.shop-gallery__arrow--prev {
    left: 0.85rem;
}

.shop-gallery__arrow--next {
    right: 0.85rem;
}

.shop-gallery__thumbs {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.9rem;
    padding-bottom: 0.25rem;
    overflow-x: auto;
}

.shop-gallery__thumb {
    flex: 0 0 5rem;
    width: 5rem;
    height: 4rem;
    padding: 0;
    overflow: hidden;
    border: 2px solid var(--tb-border);
    border-radius: 12px;
    background: var(--tb-surface);
    cursor: pointer;
}

.shop-gallery__thumb.is-active {
    border-color: var(--tb-secondary);
}

.shop-gallery__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.shop-gallery__empty {
    display: flex;
    min-height: 24rem;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    border-radius: 18px;
    background: var(--tb-bg-soft);
    color: var(--tb-text-muted);
}

.shop-gallery__empty i {
    font-size: 3rem;
}

.shop-detail__back {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    margin-bottom: 0.85rem;
    color: var(--tb-primary);
    font-weight: 700;
}

.shop-detail__title {
    margin: 0;
    color: var(--tb-text);
    font-size: clamp(2rem, 4vw, 3.25rem);
    line-height: 1.08;
    letter-spacing: -0.035em;
}

.shop-detail__price {
    margin: 0;
    font-size: 1.75rem;
}

.shop-detail__description {
    margin: 0 0 1.6rem;
    color: var(--tb-text-muted);
    font-size: 1rem;
    line-height: 1.7;
}

.shop-specs h2 {
    margin: 0 0 0.75rem;
    font-size: 1.15rem;
}

.shop-specs table {
    width: 100%;
    border-collapse: collapse;
}

.shop-specs th,
.shop-specs td {
    padding: 0.7rem 0;
    border-bottom: 1px solid var(--tb-border);
    text-align: left;
    vertical-align: top;
}

.shop-specs th {
    width: 42%;
    padding-right: 1rem;
    color: var(--tb-text-muted);
    font-weight: 600;
}

.shop-purchase {
    display: grid;
    grid-template-columns: auto minmax(4.5rem, 6rem) 1fr;
    gap: 0.75rem;
    align-items: center;
    margin-top: 1.75rem;
}

.shop-purchase__zone {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    /* Long localized ETA text in <option>s must not inflate the grid track. */
    min-width: 0;
}

.shop-purchase label {
    font-weight: 700;
}

.shop-purchase select {
    min-height: 3rem;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--tb-border);
    border-radius: 12px;
    background: var(--tb-surface);
    color: var(--tb-text);
    width: 100%;
    max-width: 100%;
    min-width: 0;
    text-overflow: ellipsis;
}

.shop-purchase .shop-btn {
    grid-column: 1 / -1;
    width: 100%;
}

.shop-secure-note {
    margin-top: 0.75rem;
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--tb-text-muted);
}

.shop-secure-note a {
    color: var(--tb-primary);
    text-decoration: underline;
}

.shop-summary {
    grid-column: 1 / -1;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--tb-border);
}

.shop-summary__row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    font-size: 1rem;
}

/* Same error red as the admin panel status — no new palette values. */
.shop-summary__row--discount {
    color: #C8472B;
    font-weight: 600;
}

.shop-summary__row--total {
    font-size: 1.25rem;
    font-weight: 700;
    margin-top: 0.25rem;
}

.shop-discount-hint {
    grid-column: 1 / -1;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin: 0;
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--tb-primary);
}

.shop-discount-hint i {
    margin-top: 0.2rem;
}

.shop-how-steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.shop-how-steps .tb-step {
    min-height: 0;
}

.shop-how-steps .tb-step__header {
    margin: 0;
}

.shop-gallery__lightbox[hidden] {
    display: none;
}

.shop-gallery__lightbox {
    position: fixed;
    z-index: 10000;
    inset: 0;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--tb-dark);
}

.shop-gallery__lightbox-content {
    display: grid;
    min-width: 0;
    justify-items: center;
    gap: 0.85rem;
}

.shop-gallery__zoom {
    display: inline-flex;
    max-width: min(80vw, 72rem);
    max-height: min(78vh, 54rem);
    align-items: center;
    justify-content: center;
    padding: 0;
    overflow: visible;
    border: 0;
    background: transparent;
    cursor: zoom-in;
}

.shop-gallery__zoom img {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 180ms ease;
}

.shop-gallery__zoom.is-zoomed {
    cursor: zoom-out;
}

.shop-gallery__zoom.is-zoomed img {
    transform: scale(var(--shop-gallery-zoom, 2.5));
}

.shop-gallery__counter {
    color: var(--tb-surface);
    font-weight: 700;
}

.shop-gallery__lightbox-arrow,
.shop-gallery__lightbox-close {
    width: 3rem;
    height: 3rem;
}

.shop-gallery__lightbox-close {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
}

.shop-lightbox-open {
    overflow: hidden;
}

.shop-page button:focus-visible,
.shop-page a:focus-visible,
.shop-page select:focus-visible {
    outline: 3px solid var(--tb-secondary);
    outline-offset: 3px;
}

@media (max-width: 860px) {
    /* Stack: gallery, then the purchase card, then description/specs.
       minmax(0, 1fr): a plain 1fr means minmax(auto, 1fr), so the thumbnail
       strip's min-content (5 fixed-width thumbs) would widen the column past
       the viewport instead of scrolling inside overflow-x. */
    .shop-detail__grid {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas:
            "media"
            "buy"
            "info";
    }

    .shop-how-steps {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .shop-catalog,
    .shop-detail {
        padding-top: 6.5rem;
    }

    .shop-purchase {
        grid-template-columns: 1fr;
    }

    .shop-gallery,
    .shop-detail__content,
    .shop-detail__info {
        padding: 0.9rem;
    }

    .shop-gallery__lightbox {
        grid-template-columns: 1fr;
        padding: 4.5rem 0.75rem 1rem;
    }

    .shop-gallery__lightbox-arrow {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
    }

    .shop-gallery__lightbox-arrow--prev {
        left: 0.75rem;
    }

    .shop-gallery__lightbox-arrow--next {
        right: 0.75rem;
    }

    .shop-gallery__zoom {
        max-width: 100%;
        max-height: 70vh;
    }
}

@media (prefers-reduced-motion: reduce) {
    .shop-card,
    .shop-btn,
    .shop-gallery__zoom img {
        transition: none;
    }

    .shop-card:hover {
        transform: none;
    }
}
