/* =====================================================================
 * [product_section] shortcode styles — namespaced .ps-* prefix
 * Designed not to clash with existing page CSS.
 * ===================================================================== */

.ps-section { margin: 30px 0; }
.ps-title { font-size: 22px; font-weight: 700; margin: 0 0 16px; color: #212529; }

/* Grid */
.ps-grid {
    display: grid;
    grid-template-columns: repeat(var(--ps-mob-cols, 2), 1fr);
    gap: 12px;
}
@media (min-width: 992px) {
    .ps-grid { grid-template-columns: repeat(var(--ps-des-cols, 4), 1fr); gap: 20px; }
}

/* Card */
.ps-card {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow .2s, transform .2s;
}
.ps-card:hover { box-shadow: 0 8px 24px rgba(0,0,0,.08); transform: translateY(-2px); }

.ps-img {
    display: block;
    aspect-ratio: 1/1;
    overflow: hidden;
    background: #f8f9fa;
}
.ps-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s; }
.ps-card:hover .ps-img img { transform: scale(1.05); }

.ps-body {
    padding: 10px 9px 14px;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.ps-name {
    font-size: 14px;
    font-weight: 500;
    color: #212529;
    text-decoration: none;
    margin-bottom: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
}
.ps-name:hover { color: #0d6efd; }

.ps-prices { margin-bottom: 10px; }
.ps-price-sale { color: #dc3545; font-weight: 700; font-size: 15px; }
.ps-price-reg { color: #6c757d; text-decoration: line-through; font-size: 12px; margin-left: 6px; }

.ps-actions {
    margin-top: auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px;
}
.ps-add-btn,
.ps-order-btn {
    display: block;
    border: 0;
    border-radius: 4px;
    padding: 7px 2px;          /* tiny side padding for Bengali */
    font-size: 12px;
    line-height: 1.25;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: background .15s, color .15s;
    white-space: normal;        /* allow wrap so text isn't cut off */
    overflow-wrap: break-word;
    min-width: 0;
}
/* Tiny phones (<400px): stack the two buttons vertically */
@media (max-width: 400px) {
    .ps-actions { grid-template-columns: 1fr; gap: 4px; }
    .ps-add-btn, .ps-order-btn { padding: 8px 6px; font-size: 12.5px; }
}
.ps-add-btn {
    background: transparent;
    color: #0d6efd;
    border: 1px solid #0d6efd;
}
.ps-add-btn:hover { background: #0d6efd; color: #fff; }
.ps-order-btn {
    background: #0d6efd;
    color: #fff;
}
.ps-order-btn:hover { background: #0a58ca; color: #fff; }
/* Standalone (when only one button outside .ps-actions) */
.ps-card > .ps-add-btn { margin-top: auto; }

.ps-empty { text-align: center; padding: 40px 20px; color: #6c757d; }

/* Carousel */
.ps-carousel-wrap { position: relative; }
.ps-carousel-track {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    padding: 6px 2px;
    scrollbar-width: none;
}
.ps-carousel-track::-webkit-scrollbar { display: none; }

.ps-slide {
    flex: 0 0 calc((100% - (var(--ps-mob-cols, 2) - 1) * 14px) / var(--ps-mob-cols, 2));
    scroll-snap-align: start;
}
@media (min-width: 992px) {
    .ps-slide { flex-basis: calc((100% - (var(--ps-des-cols, 4) - 1) * 14px) / var(--ps-des-cols, 4)); }
}

.ps-arrow {
    position: absolute;
    top: 40%;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid #dee2e6;
    box-shadow: 0 2px 8px rgba(0,0,0,.1);
    font-size: 22px;
    line-height: 1;
    color: #495057;
    cursor: pointer;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ps-arrow:hover { background: #f8f9fa; color: #0d6efd; }
.ps-arrow-prev { left: -8px; }
.ps-arrow-next { right: -8px; }
@media (max-width: 575px) {
    .ps-arrow { display: none; }
}
