
/* =====================================================
   DAILYSAFAI - CATALOGUE LAYOUT
   Single source of truth for catalogue presentation
   ===================================================== */

.shop-page {
    max-width: 1180px;
    min-width: 0;
}

.shop-page .page-heading {
    padding-bottom: 12px;
}

.shop-page .page-heading .muted {
    max-width: 720px;
    line-height: 1.65;
}

/* Product grid */

.shop-page .product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 285px), 1fr));
    gap: 22px;
    align-items: stretch;
}

/* Product card - desktop */

.shop-page .product-card {
    min-width: 0;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

/* Product image and gallery */

.shop-page .product-gallery {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    flex: 0 0 auto;
}

.shop-page .product-gallery .gallery-main,
.shop-page .product-card > .product-image {
    display: block;
    width: 100%;
    max-width: 100%;
    height: 190px;
    object-fit: contain;
    object-position: center;
    background: #fff;
    border-radius: 12px;
}

.shop-page .product-card > .product-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 190px;
    flex: 0 0 190px;
}

/* Gallery thumbnails */

.shop-page .gallery-thumbnails {
    display: flex;
    gap: 8px;
    max-width: 100%;
    margin-top: 10px;
    padding: 2px 2px 6px;
    overflow-x: auto;
}

.shop-page .gallery-thumb {
    display: block;
    flex: 0 0 58px;
    width: 58px;
    height: 58px;
    padding: 3px;
    border: 1px solid #ddd;
    border-radius: 9px;
    background: #fff;
    cursor: pointer;
}

.shop-page .gallery-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.shop-page .gallery-thumb.active {
    border: 2px solid #269b50;
}

/* Product information */

.shop-page .product-info {
    min-width: 0;
    width: 100%;
    padding: 18px;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 8px;
}

.shop-page .product-info h3 {
    font-size: 18px;
    line-height: 1.3;
    overflow-wrap: anywhere;
    margin: 0;
}

.shop-page .product-info p {
    min-height: 0;
    margin: 0;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.shop-page .product-info small {
    line-height: 1.4;
}

/* Pricing */

.shop-page .price-lines {
    display: grid;
    gap: 7px;
    margin: 6px 0 8px;
    line-height: 1.45;
}

.shop-page .price-lines span {
    display: block;
    overflow-wrap: anywhere;
}

/* Add to cart */

.shop-page .add-cart {
    width: 100%;
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 10px;
    align-items: end;
    margin-top: auto;
}

.shop-page .add-cart label {
    grid-column: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    font-size: 13px;
    font-weight: 700;
}

.shop-page .add-cart input {
    display: block;
    width: 100%;
    min-width: 0;
    height: 44px;
    padding: 9px 11px;
    font: inherit;
    border: 1px solid #dce4df;
    border-radius: 10px;
}

.shop-page .selected-price {
    grid-column: 1 / -1;
    min-width: 0;
    padding: 10px 12px;
    border-radius: 10px;
    background: #f3f8ef;
    color: #365c40;
    font-size: 12px;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.shop-page .add-cart .btn {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-width: 0;
    min-height: 48px;
    padding: 13px 16px;
    white-space: normal;
    text-align: center;
    line-height: 1.25;
    overflow: visible;
}

/* Tablet and mobile */

@media (max-width: 760px) {

    .shop-page {
        width: min(100% - 28px, 560px);
    }

    .shop-page .product-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 16px;
    }

    .shop-page .product-card {
        display: grid;
        grid-template-columns: minmax(105px, 34%) minmax(0, 1fr);
        align-items: stretch;
    }

    .shop-page .product-gallery {
        grid-column: 1;
        grid-row: 1;
    }

    .shop-page .product-gallery .gallery-main,
    .shop-page .product-card > .product-image,
    .shop-page .product-card > .product-placeholder {
        height: 180px;
        min-height: 180px;
    }

    .shop-page .product-info {
        grid-column: 2;
        grid-row: 1;
        padding: 13px;
        gap: 7px;
    }

    .shop-page .product-info h3 {
        font-size: 16px;
    }

    .shop-page .add-cart {
        grid-template-columns: minmax(0, 1fr);
        gap: 8px;
    }

    .shop-page .add-cart label,
    .shop-page .selected-price,
    .shop-page .add-cart .btn {
        grid-column: 1;
    }

    .shop-page .add-cart .btn {
        min-height: 46px;
        font-size: 13px;
    }
}

/* Small mobile screens */

@media (max-width: 390px) {

    .shop-page .product-card {
        grid-template-columns: minmax(0, 1fr);
    }

    .shop-page .product-gallery,
    .shop-page .product-info {
        grid-column: 1;
    }

    .shop-page .product-gallery {
        grid-row: 1;
    }

    .shop-page .product-info {
        grid-row: 2;
    }

    .shop-page .product-gallery .gallery-main,
    .shop-page .product-card > .product-image,
    .shop-page .product-card > .product-placeholder {
        height: 155px;
        min-height: 155px;
    }
}
