﻿/* Load AFTER the existing store stylesheet. No JavaScript required. */
.store-container {
    box-sizing: border-box;
    width: 100%;
    max-width: 1240px;
    min-width: 0;
    margin-inline: auto;
    padding-inline: clamp(12px, 2.5vw, 24px);
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: auto;
    align-items: stretch;
    justify-content: normal;
    gap: 12px 10px;
    width: 100%;
    min-width: 0;
    padding-bottom: 28px;
    padding-top: 28px;
}

    .product-grid > .product-card {
        box-sizing: border-box;
        display: flex;
        flex-direction: column;
        width: 100%;
        min-width: 0;
        max-width: none;
        height: 100%;
        margin: 0;
        justify-self: stretch;
        overflow: hidden;
        border: 1px solid #ded4c9;
        border-radius: 8px;
        background: #fffdf9;
    }

.product-card .product-photo {
    display: block;
    position: relative;
    width: 100%;
    height: auto;
    min-height: 0;
    aspect-ratio: 1;
    flex: none;
    overflow: hidden;
}

    .product-card .product-photo img {
        position: absolute;
        inset: 0;
        display: block;
        width: 100%;
        height: 100%;
        max-width: 100%;
        object-fit: cover;
    }

.product-card .product-card-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    padding: 10px;
}

.product-card .eyebrow {
    font-size: 12px;
    font-weight: 400;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.product-card .product-name {
    display: block;
    height: auto;
    min-height: 0;
    margin: 4px 0 0;
    font-family: inherit;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.4;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow-wrap: normal;
    -webkit-line-clamp: unset;
}

.product-card .product-card-pricing {
    margin: 5px 0 0;
}

.product-card .card-price-slot {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    align-content: normal;
    gap: 2px 6px;
    height: auto;
    min-height: 0;
    grid-template-rows: none;
}

.product-card .product-price {
    font-size: 15px;
    font-weight: 500;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.product-card .product-old-price {
    font-size: 12px;
    font-weight: 400;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

    .product-card .product-old-price:empty {
        display: none;
    }

.product-card .product-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
    margin-top: auto;
    padding-top: 8px;
    border-top: 0;
}

.product-card .store-contact-button,
.product-card .store-detail-button {
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-width: 0;
    min-height: 34px;
    height: auto;
    padding: 5px 4px;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.4;
    text-align: center;
    white-space: normal;
    overflow-wrap: anywhere;
    border-radius: 5px;
}

.product-card .discount-badge {
    top: 7px;
    inset-inline-start: 7px;
    padding: 3px 6px;
    font-size: 11px;
    font-weight: 400;
    line-height: 1.4;
}

@media (min-width: 600px) {
    .product-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 14px 12px;
    }
}

@media (min-width: 900px) {
    .product-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 16px 14px;
    }

    .product-card .product-card-body {
        padding: 12px;
    }

    .product-card .product-name {
        font-size: 17px;
    }

    .product-card .product-price {
        font-size: 16px;
    }

    .product-card .store-contact-button,
    .product-card .store-detail-button {
        font-size: 14px;
    }
}

@media (min-width: 1200px) {
    .product-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

@media (max-width: 299px) {
    .product-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Uniform photo frames and compact metadata. */
.product-card .product-photo {
    padding: 0;
    margin: 0;
    border: 0;
    line-height: 0;
}

    .product-card .product-photo img {
        margin: 0;
        padding: 0;
        object-position: center;
    }

.product-card .eyebrow {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-card .product-name a {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Product page: a bounded gallery with edge-to-edge photographs. */
.details-layout {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
    gap: 28px;
    padding-block: 8px 32px;
}

    .details-layout > section {
        min-width: 0;
    }

    .details-layout .gallery-main {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        height: min(460px, 55svh);
        max-width: 100%;
        aspect-ratio: auto;
        padding: 0;
        overflow: hidden;
    }

        .details-layout .gallery-main img {
            display: block;
            width: 100%;
            height: 100%;
            object-fit: cover;
            object-position: center;
        }

    .details-layout .gallery-thumbnails {
        display: flex;
        gap: 8px;
        margin-top: 8px;
        overflow-x: auto;
        padding-bottom: 4px;
    }

    .details-layout .gallery-thumbnail {
        flex: 0 0 60px;
        width: 60px;
        height: 60px;
        aspect-ratio: 1;
    }

        .details-layout .gallery-thumbnail img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

    .details-layout .details-title {
        font-size: clamp(22px, 2.2vw, 28px);
        line-height: 1.4;
        margin-block: 8px 12px;
    }

    .details-layout .store-contact-button.wide {
        width: 100%;
        max-width: 320px;
        min-height: 38px;
        height: auto;
        padding: 7px 12px;
        font-size: 15px;
    }

    .details-layout .detail-section {
        margin-top: 12px;
        padding-block: 14px;
    }

        .details-layout .detail-section h2 {
            font-size: 20px;
            margin-bottom: 8px;
        }

    .details-layout .detail-description {
        font-size: 16px;
        line-height: 1.7;
    }

    .details-layout .spec-row {
        font-size: 14px;
        overflow-wrap: anywhere;
    }

.zoom-photo {
    max-width: 100%;
    max-height: 75svh;
    object-fit: contain;
}

@media (max-width: 767px) {
    .details-layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 18px;
    }

        .details-layout .gallery-main {
            height: min(360px, 48svh);
        }
}

/* Inline WhatsApp icon, inherited button color. */
.store-contact-button {
    gap: 6px;
}

    .store-contact-button .whatsapp-icon {
        width: 16px;
        height: 16px;
        flex: 0 0 16px;
        display: block;
    }

/* Right-hand menu: hidden initially, slow slide from right to left. */
.store-sidebar {
    transform: translateX(100%);
    transition: transform 550ms cubic-bezier(.22, 1, .36, 1);
}

.menu-backdrop {
    opacity: 0;
    pointer-events: none;
    transition: opacity 550ms ease;
}

.menu-is-open .store-sidebar {
    transform: translateX(0);
}

.menu-is-open .menu-backdrop {
    opacity: 1;
    pointer-events: auto;
}

@media (prefers-reduced-motion: reduce) {
    .store-sidebar, .menu-backdrop {
        transition: none;
    }
}
