/* Lasani public storefront enhancements */
html { scroll-behavior: smooth; }

.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

.product-card:hover .product-card-cart {
    opacity: 1;
    transform: translateY(0);
}
.product-card-cart {
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.25s ease, transform 0.25s ease, background-color 0.2s;
}
@media (max-width: 768px) {
    .product-card-cart { opacity: 1; transform: none; }
}

#scroll-top {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s, transform 0.3s;
}
#scroll-top.show {
    opacity: 1;
    pointer-events: auto;
}

.flash-toast {
    animation: slideInRight 0.35s ease, fadeOut 0.4s ease 3.6s forwards;
}
@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
@keyframes fadeOut {
    to { opacity: 0; transform: translateY(-8px); }
}

.mobile-menu-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
}
.mobile-menu-panel.open {
    max-height: min(85dvh, 900px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Shop nav dropdown */
.nav-shop-dropdown.is-open .nav-shop-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}
.nav-shop-dropdown.is-open .nav-shop-chevron {
    transform: rotate(180deg);
}
.nav-shop-panel-inner {
    animation: navDropIn 0.28s ease-out;
}
@keyframes navDropIn {
    from { opacity: 0; transform: translateY(-6px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.nav-cat-item:hover .nav-cat-ring {
    box-shadow: 0 8px 24px rgba(1, 45, 29, 0.15);
}

/* Category story circles */
.story-item .story-ring {
    transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}
.story-item:hover .story-ring {
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(43, 105, 77, 0.25);
}
.story-item:hover .story-ring img {
    transform: scale(1.05);
}
.story-item .story-ring img {
    transition: transform 0.35s ease;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Hero banner — full viewport width, desktop 16:9 */
.hero-banner-section {
    width: 100%;
    max-width: none;
    margin-left: 0;
    margin-right: 0;
}
.hero-carousel-wrap {
    position: relative;
    width: 100%;
    overflow: hidden;
}
@media (min-width: 768px) {
    .hero-carousel-wrap {
        width: 100%;
        height: min(56.25vw, 1080px, 100svh);
        min-height: 420px;
        aspect-ratio: auto;
    }
}
@media (max-width: 767px) {
    .hero-carousel-wrap {
        width: 100%;
        height: min(177.78vw, 85svh, 720px);
        min-height: 420px;
        aspect-ratio: auto;
    }
}
.hero-carousel-wrap.hero-empty {
    min-height: 420px;
    aspect-ratio: auto;
    max-height: none;
}
@media (min-width: 768px) {
    .hero-carousel-wrap.hero-empty {
        min-height: min(540px, 60svh);
    }
}
.hero-media-layer .hero-bg-media,
.hero-media-layer .hero-bg-image,
.hero-media-layer .hero-bg-fallback {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.hero-media-layer .hero-bg-image {
    background-size: cover;
    background-position: center;
}
.hero-content-wrap {
    padding-top: clamp(5rem, 14vw, 8rem);
    padding-bottom: clamp(2.5rem, 8vw, 5rem);
    min-height: 100%;
    display: flex;
    align-items: center;
}

/* Usage category cards */
.usage-category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid rgba(193, 200, 194, 0.45);
    border-radius: 0.875rem;
    box-shadow: 0 2px 10px rgba(25, 28, 29, 0.04);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    text-align: center;
    box-sizing: border-box;
    text-decoration: none;
}
.usage-category-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(1, 45, 29, 0.1);
    border-color: rgba(43, 105, 77, 0.35);
}
.usage-category-icon-ring {
    border-radius: 9999px;
    background: #f3ece3;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    transition: transform 0.25s ease;
}
.usage-category-card:hover .usage-category-icon-ring {
    transform: scale(1.04);
}
.usage-category-icon-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.usage-category-icon-fallback {
    color: #414844;
    line-height: 1;
}
.usage-category-label {
    font-weight: 600;
    color: #191c1d;
    line-height: 1.35;
    margin: 0 auto;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Mobile: always 2 columns × 2 rows per swipe page */
.usage-category-mobile-wrap {
    margin-left: -1.25rem;
    margin-right: -1.25rem;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}
.usage-category-viewport {
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 0.25rem;
}
.usage-category-viewport::-webkit-scrollbar {
    display: none;
}
.usage-category-track {
    display: flex;
}
.usage-category-mobile-wrap .usage-category-page {
    flex: 0 0 100%;
    scroll-snap-align: start;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(2, minmax(0, 1fr));
    gap: 0.625rem;
    width: 100%;
    aspect-ratio: 4 / 5;
}
.usage-category-mobile-wrap .usage-category-card {
    width: 100%;
    height: 100%;
    min-height: 0;
    padding: 0.625rem 0.375rem 0.5rem;
    gap: 0.5rem;
}
.usage-category-mobile-wrap .usage-category-icon-ring {
    width: 82%;
    max-width: 11.5rem;
    aspect-ratio: 1;
    height: auto;
}
.usage-category-mobile-wrap .usage-category-icon-fallback {
    font-size: clamp(2rem, 10vw, 3rem);
}
.usage-category-mobile-wrap .usage-category-label {
    font-size: clamp(0.8125rem, 3.4vw, 0.9375rem);
    max-width: 92%;
}
.usage-category-dots {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
}
.usage-category-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 9999px;
    border: none;
    padding: 0;
    background: #c1c8c2;
    cursor: pointer;
    transition: width 0.25s ease, background-color 0.25s ease;
}
.usage-category-dot.is-active {
    width: 1.5rem;
    background: #012d1d;
}

/* Desktop — 4 cards per line, swipe to next page */
.usage-category-desktop-viewport {
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    width: 100%;
}
.usage-category-desktop-viewport::-webkit-scrollbar {
    display: none;
}
.usage-category-desktop-track {
    display: flex;
}
.usage-category-desktop-page {
    flex: 0 0 100%;
    scroll-snap-align: start;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.5rem;
    width: 100%;
}
.usage-category-desktop-page .usage-category-card {
    width: 100%;
    min-width: 0;
    height: auto;
    aspect-ratio: 320 / 400;
    padding: 1.5rem 1rem 1.25rem;
    gap: 0.875rem;
    margin: 0;
}
.usage-category-desktop-page .usage-category-icon-ring {
    width: 78%;
    max-width: 10.5rem;
    aspect-ratio: 1;
    height: auto;
}
.usage-category-desktop-page .usage-category-icon-fallback {
    font-size: 2.75rem;
}
.usage-category-desktop-page .usage-category-label {
    font-size: 1rem;
    max-width: 95%;
}
.usage-category-dots-desktop {
    margin-top: 1.25rem;
}

/* Why choose us */
.why-choose-image-frame {
    border: 4px solid rgba(1, 45, 29, 0.08);
}
.why-choose-icon {
    transition: background-color 0.2s ease, color 0.2s ease;
}
.why-choose-section li:hover .why-choose-icon {
    background-color: rgba(1, 45, 29, 0.15);
}

/* Mobile product grid tweaks on home */
@media (max-width: 639px) {
    .home-best-selling .product-card h4 {
        font-size: 0.875rem;
    }
    .home-best-selling .product-card .text-lg {
        font-size: 1rem;
    }
}

/* ========== Site-wide device optimization ========== */

/* Safe area for notched phones + floating buttons */
.store-safe-bottom {
    bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px));
}
.store-safe-bottom-scroll {
    bottom: calc(6rem + env(safe-area-inset-bottom, 0px));
}
@media (max-width: 639px) {
    .flash-toast {
        left: 1rem;
        right: 1rem;
        max-width: none;
        animation: slideInDown 0.35s ease, fadeOut 0.4s ease 3.6s forwards;
    }
    @keyframes slideInDown {
        from { transform: translateY(-100%); opacity: 0; }
        to { transform: translateY(0); opacity: 1; }
    }
}

/* Section spacing — tighter on mobile */
.store-section {
    padding-top: clamp(2.5rem, 6vw, 5rem);
    padding-bottom: clamp(2.5rem, 6vw, 5rem);
}
.store-section-heading {
    font-size: clamp(1.75rem, 5vw, 2.5rem);
    line-height: 1.2;
}
.store-page-heading {
    font-size: clamp(2rem, 6vw, 3.75rem);
    line-height: 1.15;
}

/* Prevent horizontal overflow sitewide */
main img,
main video,
main iframe,
.prose-blog img,
.prose-blog table,
.prose-blog pre {
    max-width: 100%;
    height: auto;
}
.prose-blog {
    overflow-wrap: anywhere;
    word-break: break-word;
}
.prose-blog table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.prose-blog h2 { font-size: clamp(1.25rem, 4vw, 1.75rem); }
.prose-blog h3 { font-size: clamp(1.125rem, 3.5vw, 1.375rem); }

/* Trust badges — single column on very small screens */
@media (max-width: 479px) {
    .trust-badges-grid {
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
    }
}

/* Hero — slightly shorter on small phones */
@media (max-width: 479px) {
    .hero-carousel-wrap {
        height: min(177.78vw, 78svh, 620px);
        min-height: 360px;
    }
    .hero-content-wrap h1 {
        font-size: clamp(1.75rem, 8vw, 2.25rem) !important;
    }
}

/* Why choose us — mobile badge */
.why-choose-badge-mobile {
    display: flex;
}
@media (min-width: 640px) {
    .why-choose-badge-mobile { display: none; }
}

/* Shop filter sidebar — collapsible on mobile/tablet */
.shop-filter-toggle {
    display: none;
}
@media (max-width: 1023px) {
    .shop-filter-toggle {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        padding: 0.875rem 1rem;
        margin-bottom: 0.75rem;
        background: #fff;
        border: 1px solid rgba(193, 200, 194, 0.45);
        border-radius: 0.75rem;
        font-weight: 600;
        font-size: 0.9375rem;
        color: #012d1d;
        cursor: pointer;
        box-shadow: 0 2px 8px rgba(25, 28, 29, 0.04);
    }
    .shop-filter-toggle .material-symbols-outlined {
        transition: transform 0.25s ease;
    }
    .shop-filter-toggle.is-open .material-symbols-outlined {
        transform: rotate(180deg);
    }
    .shop-filter-panel {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.35s ease;
    }
    .shop-filter-panel.is-open {
        max-height: 2400px;
    }
    .shop-sidebar-aside {
        grid-column: 1 / -1;
    }
}
@media (min-width: 1024px) {
    .shop-filter-panel {
        max-height: none !important;
        overflow: visible;
    }
}

/* Product page — stack CTAs on mobile */
@media (max-width: 639px) {
    .product-actions-row,
    .product-actions-row form {
        flex-direction: column;
        width: 100%;
        min-width: 0 !important;
    }
    .product-actions-row .btn-action,
    .product-actions-row button,
    .product-actions-row a.btn-action {
        width: 100%;
        min-width: 0 !important;
        flex: none;
    }
    .product-tabs-row {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 0.25rem;
    }
    .product-tabs-row::-webkit-scrollbar { display: none; }
    .product-tabs-row button {
        white-space: nowrap;
        flex-shrink: 0;
    }
}

/* Cart — show line total on mobile */
.cart-line-total-mobile {
    display: block;
}
@media (min-width: 640px) {
    .cart-line-total-mobile { display: none; }
}

/* Category stories — better labels on mobile */
@media (max-width: 639px) {
    .story-item span.text-xs {
        font-size: 0.6875rem;
        line-height: 1.25;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        white-space: normal;
        max-width: 88px;
    }
}

/* Footer / contact — long text wrap */
.store-break-words {
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* Pagination — compact on mobile */
@media (max-width: 479px) {
    .store-pagination nav span:not(.sr-only) {
        display: none;
    }
    .store-pagination nav a,
    .store-pagination nav span.relative {
        display: inline-flex;
    }
}

/* About quality cards — 1 col on xs */
@media (max-width: 479px) {
    .about-quality-grid {
        grid-template-columns: 1fr !important;
    }
}

/* Contact form card padding */
@media (max-width: 639px) {
    .contact-form-card {
        padding: 1.25rem !important;
    }
}

/* Checkout steps scroll on xs */
@media (max-width: 479px) {
    .checkout-steps {
        overflow-x: auto;
        flex-wrap: nowrap;
        justify-content: flex-start;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 0.25rem;
    }
    .checkout-steps::-webkit-scrollbar { display: none; }
    .checkout-steps > * { flex-shrink: 0; }
}
