/**
 * Bottom Navigation Bar Styles
 * Figma Design: node 109:18701
 * Visible on Mobile and Tablet only
 */

/* Hide on desktop */
.meercato-bottom-nav {
    display: none;
}

/* Show on mobile and tablet */
@media (max-width: 1024px) {
    /* Prevent horizontal scroll on mobile */
    html, body {
        overflow-x: hidden;
        max-width: 100vw;
    }

    .meercato-bottom-nav {
        display: block;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        background-color: #fff;
        box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.08);
        z-index: 999;
        direction: ltr;
        overflow: visible;
    }

    .meercato-bottom-nav::after {
        content: "";
        display: block;
        width: 134px;
        height: 5px;
        margin: 11px auto 8px;
        background: #000;
        border-radius: 999px;
    }

    .bottom-nav-container {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 9px 0;
        width: 100%;
        max-width: 100%;
        margin: 0 auto;
        box-sizing: border-box;
    }

    .bottom-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4.7px;
        flex: 1;
        padding: 0 12px;
        text-decoration: none;
        color: #6f6f6f;
        transition: color 0.2s ease;
    }

    .bottom-nav-item:hover {
        color: #6f6f6f;
        text-decoration: none;
    }

    button.bottom-nav-item {
        background: none;
        border: none;
        cursor: pointer;
        outline: none;
    }

    .bottom-nav-item .nav-label {
        color: #9c9c9c;
    }

    .bottom-nav-item.active {
        color: #ee3e54;
    }

    .bottom-nav-item.active .nav-label {
        color: #ee3e54;
    }

    .nav-icon {
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 30px;
        height: 30px;
    }

    .nav-icon svg {
        width: 30px;
        height: 30px;
    }

    /* Offers static SVG asset */
    .nav-offers-svg {
        width: 30px;
        height: 30px;
        object-fit: contain;
        display: block;
    }

    .nav-label {
        font-family: 'Readex Pro', 'Open Sans', sans-serif;
        font-size: 14px;
        font-weight: 400;
        line-height: 1.25em;
        text-align: center;
        white-space: nowrap;
    }

    /* Cart badge — Figma: 15x15, #6f6f6f bg, white text, top-right (LTR) */
    .cart-icon {
        position: relative;
    }

    .cart-count {
        position: absolute;
        top: 0;
        right: 0;
        min-width: 15px;
        height: 15px;
        background-color: #6f6f6f;
        border-radius: 7.5px;
        font-family: 'Poppins', sans-serif;
        font-size: 9.375px;
        font-weight: 600;
        color: #fff;
        display: flex;
        align-items: center;
        justify-content: center;
        line-height: 1;
        padding: 0 3px;
    }

    /* Add padding to body to prevent content being hidden behind nav and home indicator */
    body {
        padding-bottom: 94px;
    }

    /* Adjust footer padding when bottom nav is present */
    .meercato-footer {
        padding-bottom: 0;
    }
}

/* Tablet specific adjustments */
@media (min-width: 768px) and (max-width: 1024px) {
    .bottom-nav-container {
        max-width: 600px;
        margin: 0 auto;
    }

    .bottom-nav-item {
        padding: 0 20px;
    }

    .nav-label {
        font-size: 14px;
    }
}

/* Very small mobile */
@media (max-width: 374px) {
    .bottom-nav-item {
        padding: 0 8px;
    }

    .nav-label {
        font-size: 12px;
    }

    .nav-icon svg {
        width: 22px;
        height: 22px;
    }
}

/* ===========================================
   Categories Screen Styles
   =========================================== */
@media (max-width: 1024px) {
    .categories-screen {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 94px;
        display: flex;
        flex-direction: column;
        background: #fff;
        z-index: 1000;
        overflow: hidden;
    }

    .categories-screen-header {
        position: relative;
        display: flex;
        align-items: center;
        justify-content: flex-start;
        min-height: 64px;
        padding: calc(env(safe-area-inset-top, 0px) + 10px) 18px 10px;
        background: #fff;
        box-shadow: 0 4.48px 8.96px rgba(0, 0, 0, 0.1);
    }

    .categories-screen-back {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        padding: 0;
        border: none;
        background: transparent;
        color: #ee3e54;
        cursor: pointer;
    }

    .categories-screen-title {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        margin: 0;
        max-width: calc(100% - 120px);
        overflow: hidden;
        color: #ee3e54;
        font-family: 'Open Sans', sans-serif;
        font-size: 22px;
        font-weight: 700;
        letter-spacing: -0.04em;
        line-height: 1.36;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .categories-screen-content {
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        background: #fff;
    }

    .categories-list {
        list-style: none;
        margin: 24px 0 0;
        padding: 0;
    }

    .category-item {
        border-bottom: 1px solid #cfcfcf;
    }

    .category-item-subitem {
        border-bottom: 0;
    }

    .category-link,
    .category-link-button {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
        width: 100%;
        min-height: 68px;
        padding: 8px 22px;
        border: none;
        background: transparent;
        color: #0e0d0d;
        text-align: left;
        text-decoration: none;
        font-family: 'Open Sans', sans-serif;
        font-size: 18px;
        font-weight: 600;
        line-height: 1.36;
        cursor: pointer;
    }

    .category-link-label {
        flex: 1;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .category-link-subitem {
        min-height: 0;
        padding: 12px 22px 12px 58px;
        font-size: 19px;
        font-weight: 400;
        border-bottom: 0;
    }

    .category-link-expanded {
        cursor: default;
    }

    .category-link-arrow {
        flex-shrink: 0;
        color: #0e0d0d;
    }

    .category-link-arrow-open {
        width: 22px;
        height: 4px;
    }

    .category-link:hover,
    .category-link-button:hover {
        color: #0e0d0d;
        text-decoration: none;
        background: #fafafa;
    }

    .transition {
        transition-property: opacity, transform;
    }

    .ease-out {
        transition-timing-function: ease-out;
    }

    .ease-in {
        transition-timing-function: ease-in;
    }

    .duration-300 {
        transition-duration: 300ms;
    }

    .duration-200 {
        transition-duration: 200ms;
    }

    .opacity-0 {
        opacity: 0;
    }

    .opacity-100 {
        opacity: 1;
    }

    .translate-y-4 {
        transform: translateY(16px);
    }

    .translate-y-0 {
        transform: translateY(0);
    }
}

/* ===========================================
   Sticky Add to Cart Bar - Figma nodes 0-1099, 0-1098
   Shows above bottom navigation on product pages
   =========================================== */

.sticky-addtocart-bar {
    display: none;
}

@media (max-width: 1024px) {
    .sticky-addtocart-bar {
        display: block;
        position: fixed;
        bottom: 94px;
        left: 0;
        right: 0;
        width: 100%;
        padding: 20px 25px 10px;
        background-color: #fff;
        box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.08);
        z-index: 998;
        box-sizing: border-box;
    }

    .sticky-addtocart-container {
        display: flex;
        align-items: center;
        gap: 24px;
        width: 100%;
        max-width: 600px;
        margin: 0 auto;
    }

    .sticky-addtocart-btn {
        flex: 1 1 auto;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 4px;
        min-width: 0;
        height: 48px;
        padding: 0 32px;
        border: 0;
        border-radius: 2px;
        background: #ee3a54;
        color: #fff;
        font-family: 'Public Sans', 'Open Sans', sans-serif;
        font-size: 16px;
        font-weight: 700;
        line-height: 1.2;
        letter-spacing: 0;
        cursor: pointer;
        transition: background-color 0.2s ease, opacity 0.2s ease;
    }

    .sticky-addtocart-btn:hover {
        background: #d92f48;
    }

    .sticky-addtocart-btn:disabled {
        cursor: wait;
        opacity: 0.7;
    }

    .sticky-addtocart-btn svg {
        width: 30px;
        height: 30px;
        flex: 0 0 30px;
    }

    .sticky-addtocart-btn span {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .sticky-qty-selector {
        flex: 0 0 98px;
        display: grid;
        grid-template-columns: 1fr 29px 1fr;
        align-items: center;
        width: 98px;
        height: 48px;
        border: 1px solid #c5c5c5;
        border-radius: 2px;
        background: #fff;
        color: #0e0d0d;
        overflow: hidden;
    }

    .sticky-qty-selector .qty-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        height: 100%;
        padding: 0;
        border: 0;
        background: transparent;
        color: #222529;
        font-family: 'Open Sans', sans-serif;
        font-size: 20px;
        font-weight: 700;
        line-height: 1;
        cursor: pointer;
        transition: background-color 0.2s ease, color 0.2s ease;
    }

    .sticky-qty-selector .qty-btn:hover:not(:disabled) {
        background: #f7f7f7;
    }

    .sticky-qty-selector .qty-btn:disabled {
        color: #aaa;
        cursor: not-allowed;
    }

    .sticky-qty-selector .qty-input {
        width: 100%;
        height: 33px;
        padding: 0;
        border: 0;
        border-left: 1px solid #aaa;
        border-right: 1px solid #aaa;
        background: transparent;
        color: #0e0d0d;
        font-family: 'Open Sans', sans-serif;
        font-size: 20px;
        font-weight: 700;
        line-height: 1;
        text-align: center;
        -moz-appearance: textfield;
    }

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

    body.catalog-product-view {
        padding-bottom: 170px;
    }
}

@media (max-width: 374px) {
    .sticky-addtocart-bar {
        padding-right: 16px;
        padding-left: 16px;
    }

    .sticky-addtocart-container {
        gap: 12px;
    }

    .sticky-addtocart-btn {
        padding: 0 18px;
    }
}
