/* =========================================================
   STOREYUG - CUSTOMER FACING CSS
   Combines: Product List, Product Details, Cart, and Profile
========================================================= */

:root {
    /* Shared & List Variables */
    --primary-green: #dbeac2;
    --accent-blue: #1e3a8a;
    --text-dark: #2c3e50;
    --text-light: #95a5a6;

    /* Details & Cart Variables */
    --bg-soft: #f4f6f8;
    --accent-green: #dbeac2;
    --accent-dark-green: #5a7052;
    --primary-btn: #1e1e1e;
    --text-main: #1f2937;
    --header-height: 60px;
    --whatsapp-color: #25D366;
}

/* =========================================
   1. PAGE-SPECIFIC BODY WRAPPERS
   (Prevents font & padding conflicts)
========================================= */
.body-list-page {
    font-family: 'Poppins', sans-serif;
    background-color: #f8f9fa;
    color: var(--text-dark);
    padding-top: var(--header-height);
}

.body-details-page {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-soft);
    color: var(--text-main);
    padding-top: var(--header-height);
    padding-bottom: 100px;
}

.body-cart-page {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-soft);
    color: var(--text-main);
    padding-top: var(--header-height);
    padding-bottom: 30px;
}

.body-profile-page {
    font-family: 'Poppins', sans-serif;
    background-color: #f3f6f9;
    color: var(--text-dark);
}

@media (min-width: 992px) {
    .body-list-page {
        padding-top: 72px;
    }
}

@media (max-width: 991px) {
    .body-list-page {
        padding-top: calc(var(--header-height) + 50px + 10px);
    }

    .body-profile-page {
        background: #fff;
    }
}

@media (min-width: 768px) {
    .body-details-page {
        padding-bottom: 0;
    }
}


/* =========================================
   2. UNIVERSAL COMPONENTS (Nav & Badges)
========================================= */
.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.no-scrollbar::-webkit-scrollbar {
    display: none;
}

.navbar-custom {
    background: white;
    height: var(--header-height);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1050;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #f0f0f0;
}

.navbar-cart-shadow {
    border-bottom: none !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}

.nav-icon-btn {
    color: var(--text-main);
    font-size: 1.2rem;
    padding: 8px;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s, background 0.2s;
    border-radius: 50%;
}

.nav-icon-btn:hover {
    color: var(--accent-blue);
}

.nav-icon-btn-cart {
    width: 40px;
    height: 40px;
    padding: 0;
}

.nav-icon-btn-cart:hover {
    background-color: #f3f4f6;
    color: var(--accent-dark-green);
}

.cart-badge {
    position: absolute;
    top: 0;
    right: 0;
    background-color: #ef4444;
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 10px;
    border: 2px solid white;
    transform: translate(25%, -25%);
}


/* =========================================
   3. PRODUCT LIST PAGE STYLES
========================================= */
.search-group-nav {
    position: relative;
    flex-grow: 1;
    max-width: 600px;
}

.search-input-nav {
    border-radius: 50px;
    padding-left: 40px;
    border: 1px solid #eee;
    background-color: #f8f9fa;
    font-size: 0.9rem;
    height: 40px;
    width: 100%;
    padding-right: 75px !important;
}

.search-input-nav:focus {
    background-color: #fff;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 0.2rem rgba(30, 58, 138, 0.1);
    outline: none;
}

.search-icon-nav {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #aaa;
}

.search-clear-btn {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #95a5a6;
    cursor: pointer;
    z-index: 10;
    font-size: 1.1rem;
    padding: 5px;
    transition: color 0.2s;
}

.search-clear-btn:hover {
    color: #ef4444;
}

.action-bar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    height: 50px;
    z-index: 1040;
    display: flex;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    /*transition: transform 0.3s ease-in-out; */
}

/* .action-bar.hide-bar { transform: translateY(-100%); }*/
.action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    color: #444;
    font-size: 0.9rem;
    cursor: pointer;
    position: relative;
    gap: 8px;
}

.action-divider {
    width: 1px;
    height: 60%;
    background-color: #eaeaea;
    align-self: center;
}

.sort-select-hidden {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 5;
}

.filter-sidebar-content {
    background: white;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #eaeaea;
}

.filter-title {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.filter-section {
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 20px;
    margin-bottom: 20px;
}

.filter-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

@media (min-width: 992px) {
    .action-bar {
        display: none;
    }

    .filter-sidebar-content {
        position: sticky;
        top: 72px;
    }
}

.sort-dropdown-desktop {
    border: 1px solid #e0e0e0;
    border-radius: 50px;
    padding: 0 35px 0 15px;
    font-size: 0.9rem;
    color: #444;
    background-color: white;
    cursor: pointer;
    outline: none;
    height: 40px;
    line-height: 40px;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23444' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
}

.product-card {
    border: 1px solid #f0f0f0;
    border-radius: 12px;
    overflow: hidden;
    background: white;
    height: 100%;
    padding: 10px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.08);
}

.product-img-wrapper {
    background-color: #f4f4f4;
    position: relative;
    border-radius: 8px;
    padding: 0;
    aspect-ratio: 1/1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.product-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.5s ease;
}

.product-card:hover .product-img {
    transform: scale(1.1);
}

.discount-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background-color: #22c55e;
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
    z-index: 2;
    font-family: 'Inter', sans-serif;
}

.card-body-custom {
    padding-top: 12px;
    flex-grow: 1;
}

.product-title {
    font-size: 0.95rem;
    color: #2c3e50;
    font-weight: 500;
    margin-bottom: 2px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
}

.price-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    flex-wrap: wrap;
}

.current-price {
    font-weight: 700;
    color: #1e3a8a;
    font-family: 'Inter', sans-serif;
}

.old-price {
    text-decoration: line-through;
    color: #95a5a6;
    font-size: 0.85rem;
    font-family: 'Inter', sans-serif;
}

@media (max-width: 575.98px) {
    .product-card {
        padding: 8px;
    }

    .card-body-custom {
        padding-top: 8px;
    }

    .product-title {
        font-size: 0.85rem;
    }

    .current-price {
        font-size: 0.85rem;
    }

    .old-price {
        font-size: 0.75rem;
    }

    .price-row {
        gap: 4px;
    }
}

.rating {
    color: #ffc107;
    font-size: 0.7rem;
    margin-bottom: 5px;
}

/* Added from Profile */

.product-grid-wrapper {
    position: relative;
    min-height: 300px;
    /* THE FIX: */
    padding-top: 1px;
    /* Acts as a wall to stop the negative margin from escaping */
    margin-top: 15px;

}

#grid-overlay-spinner {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.7);
    z-index: 15;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease-in-out;
}

#grid-overlay-spinner.htmx-request {
    opacity: 1;
    pointer-events: auto;
}


/* =========================================
   4. PRODUCT DETAILS PAGE
========================================= */
.product-detail-title {
    font-size: 1.65rem;
    color: var(--text-main, #111827);
    line-height: 1.3;
}

.product-detail-price,
#mainPriceDisplay {
    color: #1e3a8a !important;
    font-weight: 700;
}

.detail-main-wrapper {
    background: white;
    border-radius: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.02);
    overflow: hidden;
    padding: 16px;
    margin-bottom: 0px;
}

.slider-wrapper {
    position: relative;
    background: #f8fafc;
    border-radius: 18px;
    margin-bottom: 0.75rem;
    width: 100%;
    aspect-ratio: 1 / 1;
    max-height: 520px;
    overflow: hidden;
    touch-action: pan-y pinch-zoom;
}

.slider-track {
    display: flex;
    height: 100%;
    transition: transform 0.35s cubic-bezier(0.25, 1, 0.5, 1);
}

.slider-slide {
    min-width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    user-select: none;
    -webkit-user-select: none;
}

.slider-slide img {
    max-width: 100%;
    max-height: 100%;
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.05));
    cursor: zoom-in;
    transition: transform 0.25s ease;
}

.slide-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    border: 1px solid #eee;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.3s, transform 0.2s;
}

.slider-wrapper:hover .slide-nav-btn {
    opacity: 1;
}

.slide-nav-btn:hover {
    background: var(--primary-btn);
    color: white;
}

.slide-nav-btn.prev {
    left: 15px;
}

.slide-nav-btn.next {
    right: 15px;
}

.thumb-list {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 5px;
    padding-top: 10px;
    justify-content: center;
}

.thumb-item {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    border: 2px solid transparent;
    flex-shrink: 0;
    overflow: hidden;
    cursor: pointer;
    opacity: 0.6;
    transition: all 0.2s;
    background: #f9fafb;
    display: flex;
    align-items: center;
    justify-content: center;
}

.thumb-item.active {
    border-color: var(--accent-dark-green);
    opacity: 1;
    transform: translateY(-2px);
}

.thumb-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 4px;
}

.category-badge {
    background-color: #e5e7eb;
    color: #4b5563;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    display: inline-block;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.discount-tag {
    background-color: #10b981;
    color: white;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 6px;
    margin-left: 10px;
    vertical-align: middle;
}

.description-box {
    background: white;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
    border: 1px solid #f3f4f6;
}

.description-content {
    max-height: 130px;
    overflow-y: auto;
    padding-right: 8px;
}

.description-content::-webkit-scrollbar {
    width: 4px;
}

.description-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.description-content::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.action-bar-container {
    margin-top: 25px;
}

.action-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
}

.qty-wrapper {
    background: #f3f4f6;
    border-radius: 30px;
    display: flex;
    align-items: center;
    padding: 5px;
    flex-shrink: 0;
}

.qty-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: white;
    font-weight: bold;
    cursor: pointer;
}

.qty-val {
    width: 38px;
    text-align: center;
    font-weight: 600;
    border: none;
    background: transparent;
    padding: 0;
    margin: 0;
    outline: none;
    box-shadow: none;
    -moz-appearance: textfield;
}

.qty-val::-webkit-outer-spin-button,
.qty-val::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.qty-val:focus {
    outline: none;
    box-shadow: none;
    border: none;
}

.button-group {
    display: flex;
    gap: 10px;
    flex-grow: 1;
    width: 100%;
}

.btn-add {
    flex: 1;
    background: white;
    color: var(--primary-btn);
    border: 2px solid var(--primary-btn);
    padding: 12px 10px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s;
    text-align: center;
    white-space: nowrap;
}

.btn-add:hover {
    background: var(--bg-soft);
}

.btn-add:active {
    transform: scale(0.95);
}

.btn-chat {
    flex: 1;
    background: #25D366;
    color: white;
    border: 2px solid #25D366;
    padding: 12px 10px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-decoration: none;
    transition: all 0.2s;
    box-shadow: 0 4px 10px rgba(37, 211, 102, 0.2);
    white-space: nowrap;
}

.btn-chat:hover {
    background: #128C7E;
    border-color: #128C7E;
    color: white;
}

.btn-chat:active {
    transform: scale(0.95);
}

@media (max-width: 768px) {
    .action-bar-container {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.85);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        padding: 15px 20px;
        box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.05);
        z-index: 1050;
        border-top: 1px solid rgba(0, 0, 0, 0.05);
        margin-top: 0;
        animation: slideUp 0.3s ease-out;
    }

    .detail-main-wrapper {
        padding: 6px;
        border-radius: 18px;
    }

    .slider-wrapper {
        height: auto;
        aspect-ratio: 1 / 1;
        border-radius: 14px;
        margin-bottom: 0.5rem;
    }

    .slider-slide {
        padding: 4px;
    }

    .thumb-list {
        padding-top: 6px;
        padding-bottom: 2px;
        gap: 8px;
        justify-content: center;
    }

    .thumb-item {
        width: 52px;
        height: 52px;
        border-radius: 10px;
    }

    .btn-add,
    .btn-chat {
        font-size: 0.85rem;
        padding: 12px 5px;
    }

    .product-detail-title {
        font-size: 1.25rem;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

/* 1. Keep the bottom nav bar at a lower stack level */
#mobile-bottom-nav {
    /* Adjust this ID or class to match your actual bottom nav */
    z-index: 1030 !important;
}

/* 2. Force the Filter Sidebar to the very front of the screen */
.offcanvas,
.offcanvas-lg,
#filterSidebar {
    z-index: 10500 !important;
}

/* 3. Force the dark background overlay to sit exactly between the nav and the menu */
.offcanvas-backdrop {
    z-index: 10490 !important;
}

/* 4. Add breathing room inside the menu so the bottom nav doesn't cover your Apply button */
#filterSidebar .offcanvas-body {
    padding-bottom: 80px !important;
}

/* =========================================
   5. CART PAGE STYLES
========================================= */
.page-title {
    font-weight: 700;
    font-size: 1.15rem;
    margin: 0;
    color: var(--text-main);
}

.cart-item {
    background: white;
    border-radius: 20px;
    padding: 15px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.02);
    position: relative;
}

.cart-img-box {
    width: 90px;
    height: 90px;
    background: #f9fafb;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.cart-img-box img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 5px;
}

.item-details {
    flex-grow: 1;
}

.item-title {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 4px;
    display: block;
    text-decoration: none;
    color: inherit;
}

.item-meta {
    font-size: 0.85rem;
    color: #6b7280;
    margin-bottom: 8px;
}

.item-price {
    font-weight: 700;
    color: var(--text-main);
    font-size: 1.1rem;
}

.qty-sm {
    display: flex;
    align-items: center;
    background: #f3f4f6;
    border-radius: 8px;
    width: fit-content;
    padding: 2px;
}

.qty-sm button {
    width: 28px;
    height: 28px;
    border: none;
    background: white;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    color: #1f2937;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
    user-select: none;
}

.qty-sm button:hover {
    background: #e5e7eb;
}

.qty-sm input,
.qty-sm span {
    width: 34px !important;
    text-align: center !important;
    font-weight: 600 !important;
    font-size: 0.9rem !important;
    border: none !important;
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
    outline: none !important;
    box-shadow: none !important;
    -moz-appearance: textfield !important;
    color: #1f2937 !important;
}

.qty-sm input::-webkit-outer-spin-button,
.qty-sm input::-webkit-inner-spin-button {
    -webkit-appearance: none !important;
    margin: 0 !important;
}

.qty-sm input:focus {
    outline: none !important;
    box-shadow: none !important;
    border: none !important;
}

.btn-remove {
    color: #ef4444;
    background: #fee2e2;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-remove:hover {
    background: #ef4444;
    color: white;
}

.summary-card {
    background: white;
    border-radius: 24px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
    position: sticky;
    top: 90px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    color: #6b7280;
    font-size: 0.95rem;
}

.summary-row.total {
    color: var(--text-main);
    font-weight: 800;
    font-size: 1.3rem;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px dashed #eee;
    margin-bottom: 25px;
}

.btn-checkout {
    background: var(--primary-btn);
    color: white;
    width: 100%;
    border: none;
    padding: 16px;
    border-radius: 14px;
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 12px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: opacity 0.2s;
}

.btn-checkout:hover {
    opacity: 0.9;
}

.promo-box {
    background: white;
    border-radius: 12px;
    padding: 10px;
    display: flex;
    margin-bottom: 20px;
}

.promo-input {
    border: none;
    background: transparent;
    flex-grow: 1;
    outline: none;
    font-size: 0.9rem;
    padding: 0 10px;
}

.promo-btn {
    border: none;
    background: var(--text-main);
    color: white;
    border-radius: 8px;
    padding: 8px 15px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* =========================================
   CART PAGE: MOBILE STICKY BOTTOM SUMMARY
========================================= */

@media (max-width: 991px) {

    /* Pin the summary card to the bottom of the screen */
    .mobile-bottom-fixed {
        position: fixed !important;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 1040;
        margin: 0 !important;
        border-radius: 24px 24px 0 0 !important;
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.1) !important;
        padding: 20px 20px 25px 20px !important;
        top: auto !important;
        /* Overrides the desktop sticky-top */
        max-height: 85vh;
        /* Prevents it from covering the whole screen if it gets too tall */
        overflow-y: auto;
    }

    /* Add space to the bottom of the page so the user can scroll past the last item */
    .cart-main-wrapper {
        padding-bottom: 280px !important;
    }

    /* Compress the spacing slightly on mobile to save screen space */
    .mobile-bottom-fixed .summary-row {
        margin-bottom: 8px;
    }

    .mobile-bottom-fixed .summary-row.total {
        margin-top: 10px;
        padding-top: 10px;
        margin-bottom: 15px;
    }

    .mobile-bottom-fixed #promoContainer {
        margin-bottom: 15px !important;
    }
}

/* =========================================
   6. STORE PROFILE PAGE STYLES
========================================= */

@media (min-width: 992px) {
    .sidebar-sticky {
        position: sticky;
        top: 30px;
        z-index: 5;
    }

    .container-main {
        max-width: 1200px;
        margin: 40px auto;
    }
}

@media (max-width: 991px) {
    .container-main {
        padding: 0;
    }

    .profile-section {
        box-shadow: none;
        border-radius: 0;
        margin-bottom: 10px;
    }

    .cover-photo {
        border-radius: 0;
    }

    .products-section {
        background: #fff;
    }
}

/* --- Left Side: Profile Card --- */
.profile-section {
    background: white;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    height: 100%;
    padding-bottom: 2rem;
    border-radius: 12px;
    overflow: visible;
    border: none;
}

.cover-photo {
    background: linear-gradient(to bottom, #dbeac2, #e6f0d5);
    height: 180px;
    position: relative;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
    z-index: 1;
}

.cover-photo-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    border-radius: inherit;
}

.default-gradient-banner {
    background: linear-gradient(135deg, #e0c3fc 0%, #8ec5fc 100%);
    background-size: cover;
}

.company-logo-small {
    position: absolute;
    top: 20px;
    left: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    height: 36px;
    box-sizing: border-box;
    padding: 0 12px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #333;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 20px;
    backdrop-filter: blur(5px);
}

.company-logo-box {
    width: 22px;
    height: 22px;
    background-color: #c4a457;
    border-radius: 4px;
    flex-shrink: 0;
}

.header-share-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    height: 36px;
    box-sizing: border-box;
    padding: 0 12px;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: none;
    color: #333;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.header-share-btn:hover {
    transform: scale(1.05);
    background: rgba(255, 255, 255, 0.85);
    color: var(--accent-blue);
}

.profile-pic-container {
    margin-top: -60px;
    text-align: center;
    position: relative;
    z-index: 10;
}

.profile-pic {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background-color: var(--accent-blue);
    border: 6px solid white;
    object-fit: cover;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-pic.default-logo-avatar {
    background: linear-gradient(135deg, var(--accent-blue), #3b82f6);
    font-size: 3.5rem;
    font-weight: 700;
    color: white;
    text-transform: uppercase;
}

.bio-text {
    font-size: 0.85rem;
    color: #666;
    max-width: 85%;
    margin: 0 auto;
    line-height: 1.6;
    white-space: pre-line;      /* keep the owner's line breaks */
    overflow-wrap: anywhere;    /* long URLs / words never overflow on mobile */
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.bio-text.is-expanded {
    display: block;
    -webkit-line-clamp: unset;
}

.bio-toggle {
    background: none;
    border: 0;
    padding: 4px 8px;
    margin-top: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #8b5cf6;
}

/* Store name (max 100 chars) must wrap, never overflow, on any screen */
.store-name {
    overflow-wrap: anywhere;
}

.products-heading-wrap {
    min-width: 0;   /* lets the heading shrink beside the "View All" button */
    flex: 1 1 auto;
}

.products-heading {
    font-size: clamp(1.1rem, 1rem + 0.4vw, 1.25rem);
    line-height: 1.3;
    overflow-wrap: anywhere;
}

/* Laptop / desktop: the profile column is narrow, so keep a long (50-char) name to ~2 lines */
@media (min-width: 992px) {
    .store-name {
        font-size: 1.6rem;
        line-height: 1.25;
    }
}

/* --- Social Icons --- */
.social-icons {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin: 20px 0 25px 0;
}

.social-btn {
    width: 42px;
    height: 42px;
    background-color: #f1f2f6;
    color: #555;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.social-btn:hover {
    transform: translateY(-3px);
    color: white;
}

.social-btn.phone-btn:hover {
    background-color: #22c55e;
}

.social-btn.email-btn:hover {
    background-color: #ea4335;
}

.social-btn.facebook-btn:hover {
    background: #1877F2;
}

.social-btn.instagram-btn:hover {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
}

.social-btn.youtube-btn:hover {
    background: #FF0000;
}

.social-btn.linkedin-btn:hover {
    background: #0077b5;
}

.social-btn.google-map-btn:hover {
    background: #ea4335;
}

/* --- Right Side: Products Section --- */
.products-section {
    padding: 20px;
}

/* Mobile Filter Dropdown */
.filter-dropdown {
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    font-size: 0.9rem;
    background-color: white;
    color: #444;
}

.filter-select {
    border: none;
    background: transparent;
    outline: none;
    padding-right: 10px;
    font-weight: 500;
}

/* --- Bottom Links --- */
.create-page-link {
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    font-size: 1.1rem;
    color: #000;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    max-width: 100%;
    text-align: left;   /* wraps neatly beside the icon on small phones */
}

.create-page-link i {
    color: #8b5cf6;
    font-size: 1.4rem;
    transform: rotate(-45deg);
}

.create-page-link:hover {
    opacity: 0.8;
    color: #000;
}

/* --- DYNAMIC GRADIENTS --- */
.bg-gradient-1 {
    background: linear-gradient(135deg, #FF9A9E 0%, #FECFEF 99%, #FECFEF 100%);
}

.bg-gradient-2 {
    background: linear-gradient(135deg, #a18cd1 0%, #fbc2eb 100%);
}

.bg-gradient-3 {
    background: linear-gradient(135deg, #84fab0 0%, #8fd3f4 100%);
}

.bg-gradient-4 {
    background: linear-gradient(135deg, #fccb90 0%, #d57eeb 100%);
}

.bg-gradient-5 {
    background: linear-gradient(135deg, #e0c3fc 0%, #8ec5fc 100%);
}


/* =========================================
   CHECKOUT PAGE STYLES
========================================= */

/* Use the existing wrapper we made for the details page! */
.detail-main-wrapper {
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
}

/* Custom Input Styling */
.custom-input {
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    background-color: #fcfcfc;
    transition: all 0.3s ease;
}

.custom-input:focus {
    background-color: #ffffff;
    border-color: var(--accent-blue, #0d6efd);
    box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.1);
}

/* Make sure floating labels look clean over the gray background */
.form-floating>label {
    color: #6c757d;
}

/* Order Summary Sticky Behavior */
@media (min-width: 992px) {
    .sticky-summary {
        position: sticky;
        top: 20px;
        /* Keeps the summary in view when scrolling a long form */
    }
}

/* Big Place Order Button */
.checkout-btn {
    font-size: 1.1rem;
    letter-spacing: 0.5px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.checkout-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(13, 110, 253, 0.2) !important;
}

/* Limit the height of the item list so it scrolls if there are 10+ items */
.checkout-items-list {
    max-height: 350px;
    overflow-y: auto;
    padding-right: 10px;
}

/* =========================================
   PRODUCT LIGHTBOX / FULLSCREEN VIEWER
========================================= */
.product-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    background: rgba(10, 10, 15, 0.97);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
}

.lightbox-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    z-index: 10;
    flex-shrink: 0;
}

.lightbox-counter {
    color: #f1f5f9;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    background: rgba(255, 255, 255, 0.12);
    padding: 4px 12px;
    border-radius: 20px;
}

.lightbox-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.lb-action-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.lb-action-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.08);
}

.lb-action-btn.lb-close-btn {
    background: rgba(239, 68, 68, 0.85);
}

.lb-action-btn.lb-close-btn:hover {
    background: #ef4444;
}

.lb-zoom-level {
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 5px 9px;
    border-radius: 20px;
    cursor: pointer;
    min-width: 48px;
    text-align: center;
    letter-spacing: 0.3px;
    transition: all 0.2s ease;
    user-select: none;
}

.lb-zoom-level:hover {
    background: rgba(255, 255, 255, 0.28);
    transform: scale(1.05);
}

.lightbox-body {
    flex: 1 1 0%;
    min-height: 0;
    height: 0;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    touch-action: none;
}

.lb-zoom-hud {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: rgba(15, 23, 42, 0.88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: #fff;
    font-size: 1.15rem;
    font-weight: 700;
    padding: 8px 18px;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    pointer-events: none;
    z-index: 50;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.lb-zoom-hud.visible {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.lightbox-stage {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

#lbImage {
    max-width: 96%;
    max-height: 96%;
    width: auto;
    height: auto;
    object-fit: contain;
    transition: transform 0.15s ease-out;
    transform-origin: center center;
    cursor: grab;
    filter: drop-shadow(0 10px 25px rgba(0, 0, 0, 0.45));
}

#lbImage:active {
    cursor: grabbing;
}

.lb-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s;
}

.lb-nav-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-50%) scale(1.08);
}

.lb-nav-btn.prev {
    left: 16px;
}

.lb-nav-btn.next {
    right: 16px;
}

@media (max-width: 768px) {
    .lb-nav-btn {
        display: none;
    }
    .lightbox-actions {
        gap: 6px;
    }
    .lb-action-btn {
        width: 34px;
        height: 34px;
        font-size: 0.85rem;
    }
}

.lightbox-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 16px max(18px, env(safe-area-inset-bottom, 18px));
    gap: 6px;
    z-index: 10;
    flex-shrink: 0;
    background: linear-gradient(to top, rgba(10, 10, 15, 0.95) 0%, rgba(10, 10, 15, 0.6) 80%, transparent 100%);
}

.lb-hint {
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.75rem;
    letter-spacing: 0.3px;
}

.lb-thumbs {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    max-width: 95vw;
    padding: 4px;
    justify-content: center;
    align-items: center;
}

.lb-thumb-item {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, 0.25);
    overflow: hidden;
    background: rgba(255, 255, 255, 0.12);
    cursor: pointer;
    flex-shrink: 0;
    opacity: 0.65;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lb-thumb-item.active {
    border-color: #ffffff;
    opacity: 1;
    transform: scale(1.08);
    box-shadow: 0 0 14px rgba(255, 255, 255, 0.4);
}

.lb-thumb-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 3px;
}


/* =========================================================
   STOREFRONT v2 — shared product card (store page + product list)
   Mobile first: 2 columns on phones, 3–4 on tablets / laptops.
========================================================= */
.sy-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

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

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

@media (min-width: 1200px) {
    .sy-grid-list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.sy-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    overflow: hidden;
    color: inherit;
    text-decoration: none;
    /* Reads as a card at rest, not only on hover */
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 4px 14px -6px rgba(15, 23, 42, 0.12);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.sy-card:focus-visible {
    outline: 2px solid var(--accent-blue);
    outline-offset: 2px;
}

@media (hover: hover) {
    .sy-card:hover {
        transform: translateY(-3px);
        border-color: #cbd5e1;
        box-shadow: 0 2px 4px rgba(15, 23, 42, 0.05), 0 18px 32px -14px rgba(15, 23, 42, 0.28);
    }

    .sy-card:hover .sy-card-media img { transform: scale(1.04); }
}

/* Every photo sits in the same soft frame, whatever its shape (never cropped) */
.sy-card-media {
    position: relative;
    aspect-ratio: 1 / 1;
    background: #f5f6f8;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.sy-card-media img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    mix-blend-mode: multiply;   /* white photo backgrounds blend into the frame */
    transition: transform 0.35s ease;
}

.sy-card-noimg {
    color: #cbd5e1;
    font-size: 2rem;
}

.sy-card-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
    background: #16a34a;
    color: #fff;
    font-family: 'Inter', sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    padding: 4px 8px;
    border-radius: 8px;
}

/* Price sits right under the title; any spare height in a row stays at the bottom of the card */
.sy-card-body {
    border-top: 1px solid #eef2f7;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    padding: 12px 14px 14px;
}

.sy-card-title {
    margin: 0;
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 500;
    line-height: 1.4;
    color: #0f172a;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    overflow-wrap: anywhere;
}

.sy-card-price {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 2px 8px;
    font-family: 'Inter', sans-serif;
}

.sy-price {
    font-size: 1.02rem;
    font-weight: 700;
    color: #0f172a;
}

/* "From ₹X": the options of this product cost different amounts */
.sy-price-from {
    font-size: 0.72em;
    font-weight: 600;
    color: #64748b;
}

.sy-mrp {
    font-size: 0.8rem;
    color: #64748b;                         /* readable in sunlight, still clearly secondary */
    text-decoration: line-through;
    text-decoration-color: rgba(100, 116, 139, 0.7);
}

.sy-card-enquire {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    background: #f0fdf4;
    color: #15803d;
    font-size: 0.78rem;
    font-weight: 600;
}

@media (max-width: 575.98px) {
    .sy-card { border-radius: 14px; }
    .sy-card-media { padding: 8px; }
    .sy-card-body { padding: 10px 10px 12px; gap: 6px; }
    .sy-card-title { font-size: 0.85rem; }
    .sy-price { font-size: 0.95rem; }
}


/* =========================================================
   STOREFRONT v3 — public store page (store_profile.html)
   Phone (< 992px): stacked "sheets", full address, contact in a sticky bottom bar.
   Laptop (≥ 992px): wide header with contact buttons, info tiles in a row,
   products full width (3–4 columns).
========================================================= */
.sp-page {
    --sp-ink: #0b1220;
    --sp-text: #334155;
    --sp-muted: #64748b;
    --sp-line: #e8ecf3;
    --sp-bg: #f4f6fb;
    --sp-accent: #2563eb;
    --sp-wa: #25d366;
    background: var(--sp-bg);
    color: var(--sp-ink);
    -webkit-font-smoothing: antialiased;
}

.sp-shell {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

@media (min-width: 768px) {
    .sp-shell {
        gap: 16px;
        padding: 20px 20px 8px;
    }
}

@media (min-width: 992px) {
    .sp-shell {
        gap: 20px;
        padding: 28px 24px 8px;
    }
}

/* ---------- Header (cover + logo + name + actions) ----------
   Phone: full-width banner, logo overlapping it.
   Tablet / laptop: banner on the left, store details beside it — so the whole 2:1
   banner shows without taking over the screen. */
.sp-hero {
    position: relative;
    background: #fff;
    border-radius: 0 0 28px 28px;
    box-shadow: 0 1px 2px rgba(11, 18, 32, 0.04);
}

@media (min-width: 768px) {
    .sp-hero {
        display: grid;
        grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
        align-items: center;
        gap: 24px;
        padding: 14px;
        border-radius: 28px;
        box-shadow: 0 1px 2px rgba(11, 18, 32, 0.04), 0 18px 40px -24px rgba(11, 18, 32, 0.25);
    }
}

@media (min-width: 992px) {
    .sp-hero {
        grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
        gap: 36px;
        padding: 16px;
    }
}

/* 2:1 = the crop tool's ratio (1200 × 600), so the banner is never cut on any screen */
.sp-cover {
    position: relative;
    aspect-ratio: 2 / 1;
    overflow: hidden;
    background-color: #c7d2fe;
}

@media (min-width: 768px) { .sp-cover { border-radius: 20px; } }

/* No cover photo: soft mesh gradient instead of a flat colour */
.sp-cover-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sp-cover-share {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 14px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.86);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    color: var(--sp-ink);
    font-size: 0.82rem;
    font-weight: 600;
    box-shadow: 0 4px 14px rgba(11, 18, 32, 0.15);
    cursor: pointer;
    transition: transform 0.15s ease, background 0.15s ease;
}

.sp-cover-share:hover { background: #fff; transform: translateY(-1px); }

/* Logo beside name + city, then bio and buttons — never overlapping the banner,
   so the merchant's whole cropped banner stays visible on every screen */
.sp-head {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    column-gap: 14px;
    align-items: center;
    padding: 16px 16px 20px;
}

.sp-head-main { display: contents; }   /* its children join the grid above */

.sp-logo {
    grid-column: 1;
    grid-row: 1 / span 2;
    width: 64px;
    height: 64px;
    border-radius: 19px;            /* rounded square: reads more "brand" than a circle */
    border: 3px solid #fff;
    background: #fff;
    box-shadow: 0 0 0 1px var(--sp-line), 0 10px 22px -12px rgba(11, 18, 32, 0.35);
    overflow: hidden;
}

.sp-logo .store-logo-container,
.sp-logo-img {
    width: 100%;
    height: 100%;
    border-radius: 16px !important;
    object-fit: cover;
}

.sp-logo-fallback { font-size: 1.7rem; }

.sp-name {
    grid-column: 2;
    grid-row: 1;
    align-self: end;
    margin: 0;
    font-family: 'Poppins', sans-serif;
    font-size: clamp(1.3rem, 1.1rem + 1vw, 1.9rem);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.01em;
    color: var(--sp-ink);
    overflow-wrap: anywhere;
}

.sp-meta {
    grid-column: 2;
    grid-row: 2;
    align-self: start;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 14px;
    margin-top: 6px;
}

.sp-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--sp-muted);
}

.sp-meta-item i { font-size: 0.8rem; }
.sp-verified { color: var(--sp-accent); }

/* City → Google Maps. Phones show a "Directions" pill (no Directions button in the header there);
   laptops already have the Directions button, so the city is just a quiet link */
.sp-meta-map { text-decoration: none; }

/* Long city names wrap (never push the Directions pill off screen); the pill drops to its own line */
.sp-meta-item { min-width: 0; max-width: 100%; }
.sp-meta-map { flex-wrap: wrap; row-gap: 6px; }
/* Pin sits outside the text flow, so it always stays beside the first line of the city */
.sp-meta-city { position: relative; min-width: 0; padding-left: 18px; overflow-wrap: anywhere; }
.sp-meta-city i { position: absolute; left: 0; top: 0.32em; }
.sp-meta-map:hover { color: var(--sp-accent); }

.sp-meta-dir {
    display: none;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;              /* ~30px tall: easy to tap */
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 0.76rem;
    font-weight: 600;
}

.sp-meta-dir i { font-size: 0.7rem; }

@media (max-width: 767.98px) {
    .sp-meta-dir { display: inline-flex; }
}

.sp-bio {
    grid-column: 1 / -1;
    max-width: 62ch;
    margin: 14px 0 0;
    font-size: 0.92rem;
    line-height: 1.65;
    color: var(--sp-text);
    white-space: pre-line;          /* keep the owner's line breaks */
    overflow-wrap: anywhere;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sp-bio.is-expanded {
    display: block;
    -webkit-line-clamp: unset;
}

.sp-bio-toggle {
    grid-column: 1 / -1;
    justify-self: start;
    margin-top: 2px;
    padding: 2px 0;
    border: 0;
    background: none;
    color: var(--sp-accent);
    font-size: 0.82rem;
    font-weight: 600;
}

/* Tablet / laptop: the details sit to the right of the banner */
@media (min-width: 768px) {
    .sp-head {
        column-gap: 16px;
        padding: 8px 16px 8px 0;
    }

    .sp-logo { width: 76px; height: 76px; border-radius: 22px; }

    .sp-logo .store-logo-container,
    .sp-logo-img { border-radius: 19px !important; }

    .sp-logo-fallback { font-size: 2rem; }

    .sp-bio { margin-top: 16px; }
    .sp-actions { grid-column: 1 / -1; }
}

@media (min-width: 992px) {
    .sp-logo { width: 88px; height: 88px; border-radius: 24px; }

    .sp-logo .store-logo-container,
    .sp-logo-img { border-radius: 21px !important; }
}

/* ---------- Header without a cover photo ----------
   No empty placeholder banner: a compact card with a soft tint at the top.
   Phone / tablet: logo · name · share icon, bio below (contact = sticky bottom bar).
   Laptop: logo · name + bio · buttons on the right. */
.sp-hero-nocover {
    display: block;
    background: linear-gradient(180deg, #eef2ff 0, #f8faff 70px, #fff 140px);
}

.sp-hero-nocover .sp-head {
    grid-template-columns: auto minmax(0, 1fr) auto;
    padding: 24px 16px 22px;
}

.sp-head-share {
    grid-column: 3;
    grid-row: 1 / span 2;
    align-self: start;
}

@media (min-width: 768px) {
    .sp-hero-nocover { display: block; padding: 0; }
    .sp-hero-nocover .sp-head { padding: 28px; column-gap: 20px; }
}

@media (min-width: 992px) {
    .sp-hero-nocover .sp-head { padding: 32px 36px; column-gap: 24px; }

    .sp-hero-nocover .sp-logo { width: 96px; height: 96px; border-radius: 26px; }
    .sp-hero-nocover .sp-logo .store-logo-container,
    .sp-hero-nocover .sp-logo-img { border-radius: 23px !important; }

    .sp-hero-nocover .sp-bio,
    .sp-hero-nocover .sp-bio-toggle { grid-column: 2; }

    /* Buttons on the right, share icon above them */
    .sp-hero-nocover .sp-actions {
        grid-column: 3;
        grid-row: 3 / span 2;   /* level with the bio, so no gap opens under the city */
        align-self: start;
        justify-content: flex-end;
        margin-top: 16px;
    }

    /* Name gets the whole width (a 50-character name fits on one line);
       share icon sits in the corner, buttons below it */
    .sp-hero-nocover .sp-head { position: relative; }

    .sp-hero-nocover .sp-name {
        grid-column: 2 / -1;
        padding-right: 56px;
        font-size: clamp(1.5rem, 1rem + 0.9vw, 1.75rem);
    }

    .sp-hero-nocover .sp-head-share {
        position: absolute;
        top: 32px;
        right: 36px;
    }
}

/* Phones: a long store name (> 24 characters) goes under the logo, full width,
   instead of squeezing into a narrow column beside it */
@media (max-width: 767.98px) {
    .sp-name-long .sp-logo { grid-row: 1; }

    .sp-name-long .sp-name {
        grid-column: 1 / -1;
        grid-row: 2;
        margin-top: 14px;
        font-size: 1.3rem;
    }

    .sp-name-long .sp-meta { grid-column: 1 / -1; grid-row: 3; }
}

/* ---------- Contact buttons ---------- */
.sp-actions {
    display: flex;
    gap: 8px;
}

.sp-action {
    flex: 1 1 0;
    min-width: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 46px;
    padding: 0 16px;
    border: 1px solid var(--sp-line);
    border-radius: 14px;
    background: #fff;
    color: var(--sp-ink);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.sp-action:hover { background: #f8fafc; color: var(--sp-ink); transform: translateY(-1px); }

.sp-action-wa {
    order: 1;                       /* phones: WhatsApp sits on the right, next to the thumb */
    flex-grow: 1.6;
    border-color: transparent;
    background: var(--sp-wa);
    color: #fff;
    box-shadow: 0 8px 18px -8px rgba(37, 211, 102, 0.7);
}

.sp-action-wa:hover { background: #1fbd5a; color: #fff; }
.sp-action-wa i { font-size: 1.15rem; }

@media (min-width: 992px) {
    .sp-actions {
        margin-top: 20px;
        flex-wrap: wrap;
    }

    .sp-action { flex: 0 0 auto; }
    .sp-action-wa { order: 0; }     /* laptop: WhatsApp first */
}

@media (max-width: 991.98px) {
    .sp-actions {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1030;
        padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
        background: rgba(255, 255, 255, 0.92);
        -webkit-backdrop-filter: blur(14px);
        backdrop-filter: blur(14px);
        border-top: 1px solid var(--sp-line);
        box-shadow: 0 -10px 30px -12px rgba(11, 18, 32, 0.18);
    }

    .sp-has-actionbar { padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }

    /* Directions lives in the Address card on phones; the bottom bar is Call + WhatsApp only */
    .sp-action-map,
    .sp-actions-maponly { display: none; }
}

/* ---------- Store info cards: Address · Store hours · Follow us ----------
   Phone: stacked cards. Tablet: 2 per row (social full width). Laptop: 3 in a row, social widest. */
.sp-cards {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    margin: 0 12px;
}

@media (min-width: 768px) {
    .sp-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 0; }
    .sp-card-social { grid-column: 1 / -1; }
}

@media (min-width: 992px) {
    /* 1, 2 or 3 cards always share the full width */
    .sp-cards { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
    .sp-card-social { grid-column: auto; }
}

.sp-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 18px;
    background: #fff;
    border: 1px solid var(--sp-line);
    border-radius: 20px;
    box-shadow: 0 1px 2px rgba(11, 18, 32, 0.04);
}

.sp-card-head {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sp-card-icon {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
}

.sp-dot-blue  { background: #eff6ff; color: #2563eb; }
.sp-dot-green { background: #ecfdf5; color: #059669; }
.sp-dot-red   { background: #fef2f2; color: #dc2626; }
.sp-dot-pink  { background: #fdf2f8; color: #db2777; }

.sp-card-title {
    margin: 0;
    font-family: 'Poppins', sans-serif;
    font-size: 0.98rem;
    font-weight: 600;
    color: var(--sp-ink);
}

.sp-card-sub {
    margin: 1px 0 0;
    font-size: 0.78rem;
    color: var(--sp-muted);
}

.sp-card-text {
    margin: 0;
    font-style: normal;
    font-size: 0.9rem;
    line-height: 1.55;
    color: var(--sp-text);
    overflow-wrap: anywhere;
}

/* Address buttons */
.sp-card-actions {
    margin-top: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.sp-mini-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 36px;
    padding: 0 14px;
    border: 1px solid var(--sp-line);
    border-radius: 11px;
    background: #fff;
    color: var(--sp-ink);
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.sp-mini-btn:hover { background: #f8fafc; color: var(--sp-ink); }

/* Phones: Directions + Copy address share the row 50 / 50 */
@media (max-width: 767.98px) {
    .sp-card-actions .sp-mini-btn {
        flex: 1 1 0;
        min-width: 0;
        justify-content: center;
        height: 40px;
        padding: 0 10px;
        white-space: nowrap;
    }
}

/* Very small phones (≤ 360px): keep button labels on one line */
@media (max-width: 360px) {
    .sp-card-actions .sp-mini-btn { font-size: 0.78rem; gap: 5px; }
}

.sp-mini-primary {
    border-color: transparent;
    background: #eff6ff;
    color: #1d4ed8;
}

.sp-mini-primary:hover { background: #dbeafe; color: #1d4ed8; }

/* Hours: status chip in the header meta line; the week opens in a small popup */
.sp-hours-chip { position: relative; min-width: 0; max-width: 100%; }

/* Wraps onto a second line when the column is narrow (long "Opens Saturday 12 AM"
   on small phones) instead of pushing the page wider than the screen */
.sp-hours-chip summary {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    column-gap: 6px;
    max-width: 100%;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    line-height: 1.45;
    list-style: none;
    cursor: pointer;
    user-select: none;
}

.sp-hours-chip summary::-webkit-details-marker { display: none; }
.sp-hours-chip.is-open summary   { background: #ecfdf5; color: #047857; }
.sp-hours-chip.is-closed summary { background: #fef2f2; color: #b91c1c; }
.sp-hours-chip strong { font-weight: 700; white-space: nowrap; }
.sp-hours-detail { font-weight: 500; white-space: nowrap; }   /* wraps as a whole phrase, never "12 / AM" */
.sp-hours-chip summary i { font-size: 0.62rem; margin-left: 2px; transition: transform 0.2s ease; }
.sp-hours-chip[open] summary i { transform: rotate(180deg); }

/* Tablet / laptop: one line — "● Closed now · Opens Saturday 12 AM ⌄" */
@media (min-width: 768px) {
    .sp-hours-chip summary i { order: 3; }
    .sp-hours-detail::before { content: "· "; }
}

/* Phones: short wording keeps the chip on one line ("● Closed ⌄ · Opens 9 AM Sat") */
.sp-hours-short { display: none; }

@media (max-width: 767.98px) {
    .sp-hours-long { display: none; }
    .sp-hours-short { display: inline; }
    .sp-hours-detail::before { content: "· "; }
}

.sp-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}

.sp-hours-chip.is-open .sp-status-dot { box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.18); }

.sp-hours-pop {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 20;
    width: 270px;
    max-width: calc(100vw - 32px);
    padding: 14px 16px 10px;
    background: #fff;
    border: 1px solid var(--sp-line);
    border-radius: 16px;
    box-shadow: 0 20px 40px -18px rgba(11, 18, 32, 0.35);
}

/* Phones: the week drops down right under the chip (like laptop), but spans the header
   width instead of starting at the chip — so it can never run off the screen */
@media (max-width: 767.98px) {
    .sp-head { position: relative; }
    .sp-hours-chip { position: static; }

    .sp-hours-pop {
        top: auto;              /* stays just below the chip */
        left: 16px;
        right: 16px;
        width: auto;
        max-width: none;
        margin-top: 8px;
    }
}

.sp-hours-pop-title {
    margin: 0 0 4px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--sp-ink);
}

.sp-hours-table {
    width: 100%;
    font-size: 0.82rem;
    color: var(--sp-muted);
}

.sp-hours-table td { padding: 5px 0; border-bottom: 1px dashed var(--sp-line); }
.sp-hours-table tr:last-child td { border-bottom: 0; }
.sp-hours-table td:last-child { text-align: right; }
.sp-hours-table .is-today td { color: var(--sp-ink); font-weight: 600; }

/* Follow us: highlighted card with brand-coloured buttons */
.sp-card-social {
    background: linear-gradient(135deg, #ffffff 0%, #fdf4ff 55%, #fce7f3 100%);
    border-color: #f5d0fe;
}

.sp-social-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
}

/* Phones: one full-width button per row — balanced for any number of links */
@media (max-width: 575.98px) {
    .sp-social-grid { grid-template-columns: minmax(0, 1fr); gap: 8px; }
    .sp-social-btn { min-height: 50px; padding: 8px 14px; }
}

.sp-social-btn {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 52px;
    padding: 8px 12px;
    border-radius: 14px;
    color: #fff;
    text-decoration: none;
    box-shadow: 0 8px 18px -12px rgba(11, 18, 32, 0.6);
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.sp-social-btn:hover {
    color: #fff;
    transform: translateY(-2px);
    filter: brightness(1.05);
    box-shadow: 0 14px 24px -14px rgba(11, 18, 32, 0.7);
}

.sp-social-btn > i:first-child { font-size: 1.25rem; flex-shrink: 0; width: 22px; text-align: center; }

.sp-social-text {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.sp-social-name { font-size: 0.86rem; font-weight: 700; }

.sp-social-handle {
    font-size: 0.74rem;
    opacity: 0.88;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sp-social-go { font-size: 0.7rem; opacity: 0.75; flex-shrink: 0; }

.sp-brand-instagram { background: linear-gradient(45deg, #f58529 0%, #dd2a7b 50%, #8134af 100%); }
.sp-brand-facebook  { background: #1877f2; }
.sp-brand-youtube   { background: #ff0000; }
.sp-brand-linkedin  { background: #0a66c2; }

/* Section order. Laptop / tablet follow the HTML: header → Why choose us → products → gallery →
   our story → address + follow us. Phones put products right after the header (customers mostly
   come for products, and the 2-column Why choose us would push them down); the city and Directions
   stay in the header / bottom card. */
@media (max-width: 767.98px) {
    .sp-products { order: 1; }
    .sp-why { order: 2; }
    .sp-gallery { order: 3; }
    .sp-story { order: 4; }
    .sp-cards { order: 5; }

    /* 6 products on phones (3 rows of 2); laptops show all 8 */
    .sp-grid > :nth-child(n + 7) { display: none; }
}

@media (min-width: 768px) {
    .sp-more.sp-more-phone-only { display: none; }
}

/* ---------- Products ---------- */
.sp-products {
    min-width: 0;
    padding: 22px 16px 24px;
    background: #fff;
    border-radius: 28px;
}

@media (min-width: 768px) {
    .sp-products {
        padding: 24px;
        border-radius: 28px;
        box-shadow: 0 1px 2px rgba(11, 18, 32, 0.04), 0 18px 40px -28px rgba(11, 18, 32, 0.25);
    }

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

@media (min-width: 992px) {
    .sp-products { padding: 28px; }
}

@media (min-width: 1200px) {
    .sp-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.sp-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.sp-section-title {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sp-section-title h2 {
    margin: 0;
    font-family: 'Poppins', sans-serif;
    font-size: clamp(1.15rem, 1.05rem + 0.4vw, 1.35rem);
    font-weight: 700;
    line-height: 1.3;
    color: var(--sp-ink);
    overflow-wrap: anywhere;      /* long store names wrap beside "View all" */
}

.sp-viewall {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 0.84rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s ease;
}

.sp-viewall i { font-size: 0.72rem; }
.sp-viewall:hover { background: #dbeafe; color: #1d4ed8; }

/* Category chips: one swipeable row on phones, wrapping on laptops */
.sp-cats {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    margin: 0 -16px 18px;
    padding: 2px 16px;
}

.sp-cats::-webkit-scrollbar { display: none; }

@media (min-width: 768px) {
    .sp-cats { flex-wrap: wrap; margin: 0 0 22px; padding: 0; overflow: visible; }
}

.sp-cat {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid var(--sp-line);
    border-radius: 999px;
    background: #fff;
    color: var(--sp-ink);
    font-size: 0.84rem;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.sp-cat span { color: #94a3b8; font-size: 0.75rem; }
.sp-cat:hover { border-color: #93c5fd; color: #1d4ed8; background: #f8fbff; }

.sp-cat-all { background: var(--sp-ink); border-color: var(--sp-ink); color: #fff; }
.sp-cat-all:hover { background: #1e293b; color: #fff; }

.sp-more {
    margin-top: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 48px;
    border: 1px solid var(--sp-line);
    border-radius: 14px;
    background: #f8fafc;
    color: #1d4ed8;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s ease;
}

.sp-more:hover { background: #eff6ff; color: #1d4ed8; }

.sp-empty {
    padding: 48px 16px;
    text-align: center;
    color: var(--sp-muted);
}

.sp-empty i { font-size: 2.4rem; color: #cbd5e1; margin-bottom: 10px; }
.sp-empty p { margin: 0; font-size: 0.9rem; }

/* ---------- Gallery: bento mosaic ----------
   Laptop / tablet: first photo large (2×2), up to 4 beside it, "+N more" on the 5th.
   Phone: magazine rhythm — wide, two squares, wide, two squares.
   Tap any photo (or "View all") → full-screen viewer. */
.sp-gallery {
    min-width: 0;
    padding: 20px 16px;
    background: #fff;
    border-radius: 28px;
}

@media (min-width: 768px) {
    .sp-gallery {
        padding: 24px;
        box-shadow: 0 1px 2px rgba(11, 18, 32, 0.04), 0 18px 40px -28px rgba(11, 18, 32, 0.25);
    }
}

@media (min-width: 992px) { .sp-gallery { padding: 24px 28px 28px; } }

.sp-gallery-all {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 14px;
    border: 0;
    border-radius: 999px;
    background: #f1f5f9;
    color: var(--sp-ink);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
}

.sp-gallery-all:hover { background: #e2e8f0; }

/* Masonry (Pinterest-style): every photo keeps its own shape.
   Laptop / tablet 4 columns, phone 2. The page script places photos left to right into the
   shortest column (.is-masonry); without it, CSS columns are the fallback. */
.sp-gallery-grid {
    column-count: 4;
    column-gap: 12px;
}

.sp-gallery-grid.is-masonry {
    column-count: auto;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.sp-gallery-col {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sp-gallery-col .sp-gallery-tile { margin: 0; }

.sp-gallery-tile {
    position: relative;
    display: block;
    width: 100%;
    margin: 0 0 12px;
    padding: 0;
    border: 0;
    border-radius: 16px;
    overflow: hidden;
    background: #f1f5f9;
    cursor: zoom-in;
    break-inside: avoid;          /* a photo never splits across two columns */
    -webkit-column-break-inside: avoid;
    isolation: isolate;
}

.sp-gallery-tile img {
    display: block;
    width: 100%;
    height: auto;                 /* natural shape */
    transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1), filter 0.3s ease;
}

.sp-gallery-tile:focus-visible { outline: 3px solid var(--sp-accent); outline-offset: 2px; }

@media (hover: hover) {
    .sp-gallery-tile:hover img { transform: scale(1.05); }
    .sp-gallery-grid:hover .sp-gallery-tile:not(:hover) img { filter: saturate(0.85) brightness(0.92); }
}

/* 1–3 photos: as many columns as photos, the gallery no wider than needed */
.sp-gal-1 { column-count: 1; max-width: 420px; }
.sp-gal-2 { column-count: 2; max-width: 760px; }
.sp-gal-3,
.sp-gal-5,
.sp-gal-6 { column-count: 3; }   /* fallback without the page script: same split as the masonry */

/* Caption strip: always visible on phones, slides up on hover on laptops */
.sp-gallery-caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 18px 10px 8px;
    background: linear-gradient(to top, rgba(11, 18, 32, 0.78), rgba(11, 18, 32, 0));
    color: #fff;
    font-size: 0.8rem;
    font-weight: 500;
    line-height: 1.35;
    text-align: left;
    pointer-events: none;
}

/* Clamp on the inner text, so the strip's padding never shows a half-cut next line */
.sp-gallery-caption > span {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@media (hover: hover) and (min-width: 768px) {
    .sp-gallery-caption { opacity: 0; transform: translateY(8px); transition: opacity 0.2s ease, transform 0.2s ease; }
    .sp-gallery-tile:hover .sp-gallery-caption,
    .sp-gallery-tile:focus-visible .sp-gallery-caption { opacity: 1; transform: none; }
}

@media (max-width: 767.98px) {
    .sp-gallery-caption { font-size: 0.74rem; padding: 14px 8px 6px; }
    .sp-gallery-caption > span { -webkit-line-clamp: 1; }
}

/* Phones: 2 columns */
@media (max-width: 767.98px) {
    .sp-gallery-grid { column-count: 2; column-gap: 8px; }
    .sp-gallery-grid.is-masonry,
    .sp-gallery-col { gap: 8px; }
    .sp-gal-1 { column-count: 1; max-width: none; }
    .sp-gal-2 { max-width: none; }
    .sp-gallery-tile { margin-bottom: 8px; border-radius: 14px; }
    .sp-gallery-all { padding: 7px 12px; font-size: 0.78rem; }
}

/* ---------- Full-screen photo viewer ---------- */
.sp-viewer {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    flex-direction: column;
    background: rgba(5, 8, 15, 0.94);
}

.sp-viewer[hidden] { display: none; }

body.sp-viewer-open { overflow: hidden; }

.sp-viewer-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px calc(12px);
    padding-top: calc(12px + env(safe-area-inset-top, 0px));
}

.sp-viewer-count {
    padding: 4px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: #f1f5f9;
    font-size: 0.85rem;
    font-weight: 600;
}

.sp-viewer-btn {
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    cursor: pointer;
    transition: background 0.15s ease;
}

.sp-viewer-btn:hover { background: rgba(255, 255, 255, 0.28); }
.sp-viewer-btn[hidden] { display: none; }

.sp-viewer-stage {
    position: relative;
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px calc(24px + env(safe-area-inset-bottom, 0px));
}

.sp-viewer-figure {
    margin: 0;
    max-width: 100%;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.sp-viewer-stage img {
    max-width: 100%;
    max-height: calc(100dvh - 170px);   /* leaves room for the caption */
    object-fit: contain;
    border-radius: 10px;
    user-select: none;
}

.sp-viewer-caption {
    max-width: 640px;
    padding: 0 12px;
    color: #f1f5f9;
    font-size: 0.95rem;
    line-height: 1.45;
    text-align: center;
    overflow-wrap: anywhere;
}

.sp-viewer-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
}

.sp-viewer-nav.is-prev { left: 16px; }
.sp-viewer-nav.is-next { right: 16px; }

@media (max-width: 767.98px) {
    .sp-viewer-nav { display: none; }   /* swipe on phones */
}

/* ---------- Footer ---------- */
.sp-footer {
    display: flex;
    justify-content: center;
    padding: 24px 16px 32px;
}

.sp-powered {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border: 1px solid var(--sp-line);
    border-radius: 999px;
    background: #fff;
    color: var(--sp-text);
    font-size: 0.9rem;
    text-decoration: none;
    transition: border-color 0.15s ease, color 0.15s ease;
}

.sp-powered i { color: #8b5cf6; transform: rotate(-45deg); }
.sp-powered strong { color: var(--sp-ink); }
.sp-powered:hover { border-color: #c4b5fd; color: var(--sp-ink); }

/* Phones: keep the line on one row (scales with screen width) */
@media (max-width: 575.98px) {
    .sp-powered {
        gap: 6px;
        padding: 8px 14px;
        font-size: clamp(0.68rem, 3.3vw, 0.85rem);
        white-space: nowrap;
    }
}

/* ---------- Compact top bar (after scrolling past the header) ---------- */
.sp-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1040;
    background: rgba(255, 255, 255, 0.9);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--sp-line);
    transform: translateY(-100%);
    transition: transform 0.25s ease;
}

.sp-topbar.is-visible { transform: translateY(0); }

.sp-topbar-inner {
    max-width: 1200px;
    margin: 0 auto;
    height: 58px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

@media (min-width: 992px) { .sp-topbar-inner { padding: 0 24px; } }

.sp-topbar-logo {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 11px;
    overflow: hidden;
    box-shadow: 0 0 0 1px var(--sp-line);
}

.sp-topbar-logo .store-logo-container,
.sp-topbar-logo-img {
    width: 100%;
    height: 100%;
    border-radius: 11px !important;
    object-fit: cover;
    font-size: 1rem;
}

.sp-topbar-name {
    flex: 1;
    min-width: 0;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 0.98rem;
    color: var(--sp-ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sp-topbar-wa {
    display: none;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 14px;
    border-radius: 999px;
    background: var(--sp-wa);
    color: #fff;
    font-size: 0.84rem;
    font-weight: 600;
    text-decoration: none;
}

.sp-topbar-wa:hover { background: #1fbd5a; color: #fff; }

@media (min-width: 992px) {
    .sp-topbar-wa { display: inline-flex; }   /* phones already have the bottom bar */
}

.sp-icon-btn {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    border: 1px solid var(--sp-line);
    border-radius: 12px;
    background: #fff;
    color: var(--sp-ink);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s ease;
}

.sp-icon-btn:hover { background: #f8fafc; }

/* ---------- "Link copied" toast ---------- */
.sp-toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    z-index: 1100;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 999px;
    background: var(--sp-ink);
    color: #fff;
    font-size: 0.88rem;
    font-weight: 500;
    box-shadow: 0 10px 30px rgba(11, 18, 32, 0.3);
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 16px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.sp-toast i { color: #4ade80; }
.sp-toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 991.98px) {
    .sp-has-actionbar .sp-toast { bottom: calc(88px + env(safe-area-inset-bottom, 0px)); }
}

@media (prefers-reduced-motion: reduce) {
    .sy-card, .sy-card-media img, .sp-action, .sp-social-btn, .sp-cover-share, .sp-toast, .sp-topbar { transition: none; }
    .sy-card:hover, .sy-card:hover .sy-card-media img { transform: none; }
}

/* ---------- "Why choose us": its own card after the header ----------
   Phone: 2 columns, icon beside text. Tablet / laptop: tiles with the icon on top,
   columns follow the count (5 or 6 → 3 per row) so rows are never left half empty. */
.sp-why {
    min-width: 0;
    padding: 20px 16px;
    background: #fff;
    border-radius: 28px;
}

.sp-why-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.sp-why-1 { grid-template-columns: minmax(0, 1fr); }

.sp-why-item {
    --why-bg: #ecfdf5;
    --why-ink: #059669;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--sp-line);
    border-radius: 18px;
    background: linear-gradient(180deg, #fff 0%, #fafbfd 100%);
    font-size: 0.84rem;
    font-weight: 600;
    line-height: 1.35;
    color: var(--sp-ink);
}

/* A different soft tint per tile */
.sp-why-item:nth-child(6n + 2) { --why-bg: #eff6ff; --why-ink: #2563eb; }
.sp-why-item:nth-child(6n + 3) { --why-bg: #fff7ed; --why-ink: #ea580c; }
.sp-why-item:nth-child(6n + 4) { --why-bg: #fdf2f8; --why-ink: #db2777; }
.sp-why-item:nth-child(6n + 5) { --why-bg: #f5f3ff; --why-ink: #7c3aed; }
.sp-why-item:nth-child(6n + 6) { --why-bg: #f0fdfa; --why-ink: #0d9488; }

.sp-why-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--why-bg);
    color: var(--why-ink);
    font-size: 0.92rem;
}

.sp-why-text { min-width: 0; overflow-wrap: anywhere; }

@media (min-width: 768px) {
    .sp-why {
        padding: 24px;
        box-shadow: 0 1px 2px rgba(11, 18, 32, 0.04), 0 18px 40px -28px rgba(11, 18, 32, 0.25);
    }

    /* Tablet: 3 per row (2 when there are 2 or 4) */
    .sp-why-grid { gap: 14px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .sp-why-1 { grid-template-columns: minmax(0, 1fr); }
    .sp-why-2,
    .sp-why-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

    .sp-why-item {
        flex-direction: column;
        justify-content: center;
        gap: 12px;
        padding: 20px 14px;
        text-align: center;
        font-size: 0.9rem;
        transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    }

    .sp-why-icon { width: 48px; height: 48px; border-radius: 16px; font-size: 1.1rem; }
}

@media (hover: hover) and (min-width: 768px) {
    .sp-why-item:hover {
        transform: translateY(-2px);
        border-color: transparent;
        box-shadow: 0 14px 30px -18px rgba(11, 18, 32, 0.35);
    }
}

/* Laptop: every highlight in one row */
@media (min-width: 992px) {
    .sp-why { padding: 24px 28px 28px; }
    .sp-why-grid { gap: 16px; }
    .sp-why-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .sp-why-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .sp-why-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
    .sp-why-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
    /* 1-2 highlights: icon beside the text, so wide cards don't look empty */
    .sp-why-1 .sp-why-item,
    .sp-why-2 .sp-why-item { flex-direction: row; justify-content: flex-start; text-align: left; padding: 18px; }
}

/* ---------- Our story ----------
   Phone: owner on top, story below. Tablet / laptop: owner panel beside the story. */
.sp-story {
    min-width: 0;
    display: grid;
    gap: 18px;
    padding: 20px 16px;
    background: #fff;
    border-radius: 28px;
}

@media (min-width: 768px) {
    .sp-story {
        grid-template-columns: 220px minmax(0, 1fr);
        align-items: stretch;
        gap: 28px;
        padding: 24px;
        box-shadow: 0 1px 2px rgba(11, 18, 32, 0.04), 0 18px 40px -28px rgba(11, 18, 32, 0.25);
    }

    .sp-story:not(:has(.sp-story-owner)) { grid-template-columns: minmax(0, 1fr); }
}

@media (min-width: 992px) {
    .sp-story { grid-template-columns: 260px minmax(0, 1fr); gap: 36px; padding: 28px; }
}

.sp-story-owner {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 14px;
}

@media (min-width: 768px) {
    .sp-story-owner {
        flex-direction: column;
        justify-content: center;
        gap: 12px;
        padding: 24px 16px;
        border-radius: 22px;
        background:
            radial-gradient(120% 80% at 0% 0%, #eef2ff 0%, transparent 60%),
            radial-gradient(120% 80% at 100% 100%, #ecfdf5 0%, transparent 60%),
            #f8fafc;
        text-align: center;
    }
}

.sp-story-avatar {
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #6366f1, #2563eb);
    color: #fff;
    font-family: 'Poppins', sans-serif;
    font-size: 1.6rem;
    font-weight: 700;
    box-shadow: 0 0 0 3px #fff, 0 0 0 5px #dbeafe;
}

.sp-story-avatar img { width: 100%; height: 100%; object-fit: cover; }

@media (min-width: 768px) {
    .sp-story-avatar { width: 112px; height: 112px; font-size: 2.6rem; box-shadow: 0 0 0 4px #fff, 0 0 0 7px #dbeafe; }
}

.sp-story-owner figcaption {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sp-story-name {
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--sp-ink);
    overflow-wrap: anywhere;
}

.sp-story-role {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--sp-muted);
    overflow-wrap: anywhere;
}

.sp-story-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 12px;
}

.sp-story-title {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Poppins', sans-serif;
    font-size: clamp(1.15rem, 1.05rem + 0.4vw, 1.35rem);
    font-weight: 700;
    line-height: 1.3;
    color: var(--sp-ink);
}

.sp-story-mark {
    width: 34px;
    height: 34px;
    border-radius: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #eff6ff;
    color: var(--sp-accent);
    font-size: 0.85rem;
}

.sp-story-text {
    margin: 0;
    max-width: 68ch;
    font-size: 0.93rem;
    line-height: 1.75;
    color: var(--sp-text);
    white-space: pre-line;
    overflow-wrap: anywhere;
}

.sp-story-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 2px;
}

.sp-story-stat {
    display: inline-flex;
    flex-direction: column;
    min-width: 112px;
    padding: 10px 16px;
    border: 1px solid var(--sp-line);
    border-radius: 16px;
    font-size: 0.76rem;
    font-weight: 500;
    color: var(--sp-muted);
}

.sp-story-stat strong {
    font-family: 'Poppins', sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--sp-ink);
}

/* Phones: an inset card like Address / Follow us (12px side gap, border); heading first, then the owner */
@media (max-width: 767.98px) {
    .sp-story {
        gap: 14px;
        margin: 0 12px;
        padding: 18px;
        border: 1px solid var(--sp-line);
        border-radius: 20px;
        box-shadow: 0 1px 2px rgba(11, 18, 32, 0.04);
    }
    .sp-story-main { display: contents; }
    .sp-story-title { order: -1; }
}
