/* ==========================================================================
   GRITO WEBSITE - MOBILE & TABLET RESPONSIVE STYLESHEET
   Comprehensive adaptive system for index.html (RU) and en.html (EN)
   Breakpoints:
     - Tablets: <= 1024px & <= 992px
     - Small Tablets / Large Phones: <= 768px
     - Smartphones: <= 640px & <= 480px
   ========================================================================== */

/* --------------------------------------------------------------------------
   0. Zero Horizontal Overflow & Base Mobile Resets
   -------------------------------------------------------------------------- */
html, body {
    overflow-x: clip !important;
    overflow-x: hidden !important;
    max-width: 100% !important;
    width: 100% !important;
    position: relative;
    -webkit-text-size-adjust: 100%;
}

section[id] {
    scroll-margin-top: 80px;
}

*, *::before, *::after {
    box-sizing: border-box;
}

img {
    max-width: 100%;
    height: auto;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

/* Add bottom padding on mobile so sticky bottom bar doesn't cover content */
@media (max-width: 768px) {
    body {
        padding-bottom: 74px !important;
    }
}

/* --------------------------------------------------------------------------
   1. Header, Hamburger Toggle & Language Switcher
   -------------------------------------------------------------------------- */
.mobile-menu-toggle {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 6px;
    margin-left: 8px;
    z-index: 1002;
    flex-direction: column;
    justify-content: space-between;
    width: 36px;
    height: 30px;
    flex-shrink: 0;
}

.mobile-menu-toggle span {
    display: block;
    width: 100%;
    height: 3px;
    background: #ffffff !important; /* White lines on black header */
    border-radius: 3px;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

@media (max-width: 992px) {
    .nav-menu {
        display: none !important;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .header-inner {
        padding: 10px 16px !important;
    }

    .header-right {
        display: flex !important;
        align-items: center !important;
        gap: 8px !important;
    }

    .lang-switch-btn {
        padding: 5px 10px !important;
        font-size: 12.5px !important;
    }
}

@media (max-width: 480px) {
    .logo-img {
        height: 34px !important;
    }
    .logo-sub {
        font-size: 8px !important;
        letter-spacing: 1.5px !important;
    }
}

/* --------------------------------------------------------------------------
   2. Mobile Drawer Navigation
   -------------------------------------------------------------------------- */
.mobile-drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-drawer-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 320px;
    max-width: 86vw;
    height: 100vh;
    background: #FFFDF9;
    z-index: 9999;
    box-shadow: -6px 0 28px rgba(0, 0, 0, 0.18);
    display: flex;
    flex-direction: column;
    transform: translateX(105%);
    visibility: hidden;
    pointer-events: none;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.35s ease;
    will-change: transform;
    overflow-y: auto;
}

.mobile-drawer.active {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
}

.mobile-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.drawer-logo {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.drawer-logo img {
    height: 32px;
    width: auto;
}

.drawer-logo span {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: #9A1608;
    margin-top: 2px;
}

.mobile-drawer-close {
    background: none;
    border: none;
    font-size: 32px;
    line-height: 1;
    color: #000000;
    cursor: pointer;
    padding: 4px;
}

.mobile-drawer-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
    justify-content: space-between;
}

.mobile-drawer-nav {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mobile-drawer-nav li {
    margin-bottom: 4px;
}

.mobile-drawer-nav li a {
    display: block;
    padding: 10px 12px;
    font-family: 'RF Dewi', sans-serif;
    font-weight: 600;
    font-size: 15px;
    color: #111111;
    text-decoration: none;
    border-radius: 8px;
    transition: background 0.15s ease, color 0.15s ease;
}

.mobile-drawer-nav li a:hover,
.mobile-drawer-nav li a:active {
    background: rgba(154, 22, 8, 0.08);
    color: #9A1608;
}

.mobile-drawer-actions {
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mobile-drawer-btn-cta {
    background: #9A1608;
    color: #ffffff !important;
    text-align: center;
    padding: 13px 16px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
    display: block;
    box-shadow: 0 4px 14px rgba(154, 22, 8, 0.25);
}

.mobile-drawer-btn-wa {
    background: #25D366;
    color: #ffffff !important;
    text-align: center;
    padding: 12px 16px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.mobile-drawer-phone {
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: #333333;
    text-decoration: none;
    padding: 6px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

/* --------------------------------------------------------------------------
   3. Mobile Sticky Bottom Bar (Conversion Powerhouse)
   -------------------------------------------------------------------------- */
.mobile-sticky-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9990;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    padding: 10px 16px;
    gap: 12px;
    align-items: center;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
}

@media (max-width: 768px) {
    .mobile-sticky-bar {
        display: flex;
    }
}

.sticky-bar-cta-btn {
    flex: 1;
    background: #9A1608;
    color: #ffffff !important;
    text-align: center;
    padding: 12px 16px;
    border-radius: 8px;
    font-family: 'RF Dewi', sans-serif;
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(154, 22, 8, 0.25);
}

.sticky-bar-wa-btn {
    width: 44px;
    height: 44px;
    background: #25D366;
    color: #ffffff !important;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    text-decoration: none;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

/* --------------------------------------------------------------------------
   4. Hero Section Responsiveness
   -------------------------------------------------------------------------- */
@media (min-width: 769px) and (max-width: 1024px) {
    .hero {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: flex-start !important;
        position: relative !important;
        padding: 100px 32px 50px !important;
        min-height: auto !important;
        overflow: hidden !important;
    }

    .hero-inner {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        position: relative !important;
        z-index: 2 !important;
    }

    .hero-left {
        max-width: 530px !important;
        width: 100% !important;
        margin: 0 !important;
        text-align: left;
    }

    .hero-title {
        font-size: 38px !important;
        line-height: 1.15 !important;
        margin-bottom: 12px !important;
        word-wrap: break-word;
    }

    .hero-margin-sub {
        font-size: 28px !important;
        margin-bottom: 14px !important;
    }

    .hero-desc-text {
        font-size: 14.5px !important;
        line-height: 1.5 !important;
        margin-bottom: 24px !important;
    }

    .hero-ramen-img {
        position: absolute !important;
        right: -30px !important;
        top: 52% !important;
        transform: translateY(-50%) !important;
        width: 520px !important;
        max-width: 50vw !important;
        height: auto !important;
        margin: 0 !important;
        display: block !important;
        z-index: 1 !important;
        pointer-events: none !important;
    }
}

@media (max-width: 768px) {
    .hero {
        display: flex !important;
        flex-direction: column !important;
        justify-content: flex-start !important;
        align-items: center !important;
        padding-top: 90px !important;
        min-height: auto !important;
        padding-left: 20px !important;
        padding-right: 20px !important;
        padding-bottom: 40px !important;
    }

    .hero-inner {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 auto !important;
        display: block !important;
        padding: 0 !important;
    }

    .hero-left {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        text-align: left;
    }

    .hero-title {
        font-size: clamp(26px, 7vw, 46px) !important;
        line-height: 1.15 !important;
        margin-bottom: 12px !important;
        word-wrap: break-word;
    }

    .hero-margin-sub {
        font-size: clamp(20px, 5vw, 30px) !important;
        margin-bottom: 14px !important;
    }

    .hero-desc-text {
        font-size: 14px !important;
        line-height: 1.5 !important;
        margin-bottom: 24px !important;
    }

    .hero-ramen-img {
        display: none !important;
    }
}

@media (max-width: 600px) {
    .hero-btn-row {
        flex-direction: column !important;
        width: 100% !important;
        gap: 10px !important;
    }

    .hero-btn-red,
    .hero-btn-beige {
        width: 100% !important;
        text-align: center !important;
        justify-content: center !important;
        padding: 13px 18px !important;
    }

    .hero-chip-row {
        flex-wrap: wrap !important;
        gap: 8px !important;
        width: 100% !important;
    }

    .hero-chip-sq {
        font-size: 13px !important;
        padding: 8px 16px !important;
    }
}

/* --------------------------------------------------------------------------
   5. Product Catalog: Swipeable Tabs & Responsive Grid
   -------------------------------------------------------------------------- */
.catalog-tabs {
    overflow: visible;
    padding-top: 8px;
    padding-bottom: 12px;
}

@media (max-width: 1024px) {
    .catalog-tabs {
        display: flex !important;
        overflow-x: auto !important;
        white-space: nowrap !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none !important;
        gap: 8px !important;
        padding-top: 8px !important;
        padding-bottom: 12px !important;
        padding-left: 8px !important;
        padding-right: 8px !important;
        margin-bottom: 24px !important;
        max-width: 100% !important;
    }

    .catalog-tabs::-webkit-scrollbar {
        display: none !important;
    }

    .tab-btn {
        flex-shrink: 0 !important;
        padding: 10px 18px !important;
        font-size: 14px !important;
    }
}

@media (max-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 20px !important;
    }
}

@media (max-width: 640px) {
    .products-grid {
        grid-template-columns: 1fr !important;
        gap: 24px !important;
    }

    .product-card {
        max-width: 100% !important;
    }

    .sku-badge-group {
        gap: 6px !important;
    }

    .sku-chip {
        font-size: 12px !important;
        padding: 6px 10px !important;
    }
}

/* --------------------------------------------------------------------------
   6. Wholesale Profit Calculator
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
    #calc-section {
        min-height: auto !important;
        height: auto !important;
        overflow: visible !important;
        padding-top: 40px !important;
        padding-bottom: 40px !important;
        display: block !important;
    }

    .calc-section-wrap {
        transform: none !important;
    }

    #calc-section .calc-box,
    .calc-box {
        display: flex !important;
        flex-direction: column !important;
        margin-top: 0 !important;
        padding: 28px 18px !important;
        gap: 28px !important;
        transform: none !important;
        min-width: 0 !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .calc-left {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }

    .calc-left h3 {
        margin-top: 0 !important;
        padding-top: 4px !important;
        font-size: clamp(20px, 5.5vw, 28px) !important;
        line-height: 1.25 !important;
    }

    .form-slider label {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 6px !important;
        justify-content: space-between !important;
    }

    .calc-val-left-wrap {
        flex-shrink: 0 !important;
    }

    .calc-result-card {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        padding: 24px 16px !important;
        box-sizing: border-box !important;
    }

    .result-value {
        font-size: clamp(28px, 7vw, 48px) !important;
    }
}

@media (max-width: 480px) {
    #calc-section .calc-box,
    .calc-box {
        padding: 20px 14px !important;
        border-radius: 18px !important;
        gap: 20px !important;
    }

    .calc-result-card {
        padding: 20px 14px !important;
        border-radius: 16px !important;
    }

    .result-value {
        font-size: 26px !important;
    }
}

@media (hover: none) and (pointer: coarse), (max-width: 768px) {
    .slider::-webkit-slider-thumb {
        width: 28px !important;
        height: 28px !important;
    }

    .slider::-moz-range-thumb {
        width: 28px !important;
        height: 28px !important;
    }

    .slider-badge-wrap {
        display: none !important; /* Hide pin tag on touch/mobile to prevent obscuring finger and thumb */
    }
}

/* --------------------------------------------------------------------------
   7. Interactive Delivery Map & Country Badges
   -------------------------------------------------------------------------- */
.country-badges-container {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    white-space: nowrap !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: thin !important;
    scrollbar-color: #ce181e rgba(0, 0, 0, 0.08) !important;
    padding-bottom: 10px !important;
    gap: 8px !important;
    justify-content: flex-start !important;
    max-width: 100% !important;
}

.country-badges-container::-webkit-scrollbar {
    display: block !important;
    height: 5px !important;
}

.country-badges-container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.08) !important;
    border-radius: 6px !important;
}

.country-badges-container::-webkit-scrollbar-thumb {
    background: #ce181e !important;
    border-radius: 6px !important;
}

.country-badge {
    flex: 0 0 auto !important;
    flex-shrink: 0 !important;
    white-space: nowrap !important;
}

@media (max-width: 768px) {
    .country-badges-container {
        margin-left: -12px !important;
        margin-right: -12px !important;
        padding-left: 12px !important;
        padding-right: 12px !important;
        width: calc(100% + 24px) !important;
        max-width: calc(100% + 24px) !important;
    }

    #map-container {
        height: 380px !important;
    }

    .map-header h3 {
        font-size: 22px !important;
    }
}

/* --------------------------------------------------------------------------
   8. Why Partnering (Benefits) & Steps
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
    #benefits {
        min-height: auto !important;
        height: auto !important;
        padding: 40px 16px 24px !important;
        display: block !important;
    }

    .benefits-container-new {
        flex-direction: column !important;
        min-height: auto !important;
        margin-bottom: 0 !important;
    }

    .benefits-content-left {
        max-width: 100% !important;
    }

    .benefits-content-left h2 {
        margin-bottom: 18px !important;
        font-size: clamp(24px, 6vw, 36px) !important;
    }

    .benefits-grid-new {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 16px !important;
    }

    /* Hide chef image on mobile and tablet as requested */
    .benefits-right-chef-img,
    .benefits-sun-bg {
        display: none !important;
    }
}

@media (max-width: 600px) {
    .benefits-grid-new {
        grid-template-columns: 1fr !important;
        gap: 14px !important;
    }

    .benefit-card-new {
        padding: 16px !important;
    }

    .benefit-card-text h3 {
        font-size: 17px !important;
    }

    .benefit-card-text p {
        font-size: 13px !important;
    }
}

/* 4 Steps */
#steps .section-header h2,
.steps-section .section-header h2,
.section-header h2 {
    word-break: normal !important;
    overflow-wrap: break-word !important;
    max-width: 100% !important;
}

#steps .section-header h2 span,
.steps-section .section-header h2 span,
.section-header h2 span {
    white-space: normal !important;
    display: inline !important;
}

@media (max-width: 1024px) {
    #steps > .section-wrap {
        padding-bottom: 110px !important;
    }

    #support > .section-wrap {
        padding-top: 110px !important;
    }

    .steps-bottom-pack-img {
        width: clamp(280px, 75vw, 440px) !important;
    }
}

@media (max-width: 768px) {
    #steps .section-header h2,
    .steps-section .section-header h2 {
        font-size: clamp(22px, 6.2vw, 36px) !important;
        line-height: 1.2 !important;
    }
}

/* Portrait orientation safety: prevent 100vh gaping voids on all portrait screens */
@media (max-width: 1024px), (max-aspect-ratio: 1/1) {
    .hero,
    #benefits,
    #calc-section {
        min-height: auto !important;
        height: auto !important;
    }
}

@media (max-width: 992px) {
    .steps-grid-new {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 16px !important;
    }
}

@media (max-width: 576px) {
    .steps-grid-new {
        grid-template-columns: 1fr !important;
    }
}

/* Support Grid */
@media (max-width: 992px) {
    .support-grid-new {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 16px !important;
    }
}

@media (max-width: 576px) {
    .support-grid-new {
        grid-template-columns: 1fr !important;
    }
}

/* --------------------------------------------------------------------------
   9. FAQ Section
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
    .faq-left-ramen-img {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .faq-item-new summary {
        padding: 16px 14px !important;
    }

    .faq-question-text {
        font-size: 14px !important;
        line-height: 1.4 !important;
    }

    .faq-answer-content {
        padding: 0 14px 16px !important;
        font-size: 14px !important;
        line-height: 1.6 !important;
    }
}

/* --------------------------------------------------------------------------
   10. CTA Form Section & Footer
   -------------------------------------------------------------------------- */
@media (max-width: 992px) {
    .cta-right-chopsticks-img {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .cta-form-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    .cta-input-field {
        height: 50px !important;
        font-size: 16px !important; /* 16px prevents iOS Safari from automatically zooming the page */
        padding: 12px 14px !important;
    }

    .hero-btn-red {
        height: 52px !important;
        font-size: 15px !important;
    }

    .footer-grid-new {
        grid-template-columns: 1fr !important;
        text-align: center !important;
        gap: 28px !important;
    }

    .footer-logo-col-new {
        align-items: center !important;
    }

    .footer-contact-list {
        align-items: center !important;
    }

    .footer-social-new {
        align-items: center !important;
        justify-content: center !important;
    }
}
