:root {
    --primary-orange: #f38400;
    /* Logo Orange */
    --hover-orange: #d67400;
    --text-dark: #1a1a1a;
    --text-body: #444444;
    --text-muted: #8e8e93;
    --white: #ffffff;
    --red-badge: #e63946;
    --green-accent: #28a745;
    --border-color: #efefef;
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--white);
    color: var(--text-body);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    /* Prevent horizontal scroll */
}

html {
    overflow-x: hidden;
}

/* Perfect alignment for all sections */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

/* --- Navigation & Header --- */
.main-header {
    background: var(--white);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-top {
    padding: 15px 0;
}

.header-flex {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 80px;
}

.logo img {
    height: 60px;
    display: block;
    margin-left: -5px;
    /* Aligns visually with the grid content below */
}

.search-form {
    flex: 1;
    display: flex;
    max-width: 650px;
    height: 48px;
    border: 1px solid #dcdcdc;
    border-radius: 6px;
    overflow: hidden;
    transition: var(--transition);
    margin-right: auto;
    /* Pushes the search bar towards the left logo area but keeps it flexible */
}

.search-form:focus-within {
    border-color: var(--primary-orange);
    box-shadow: 0 0 0 3px rgba(243, 132, 0, 0.1);
}

.search-form input {
    flex: 1;
    border: none;
    padding: 0 20px;
    font-size: 15px;
    outline: none;
    color: var(--text-dark);
}


.search-form button {
    background: var(--primary-orange);
    color: white;
    border: none;
    padding: 0 25px;
    cursor: pointer;
    font-size: 18px;
}

/* WhatsApp Button */
.btn-whatsapp {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #25d366;
    color: white !important;
    padding: 10px 20px;
    border-radius: 6px;
    /* Matches search form radius */
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
    transition: var(--transition);
    white-space: nowrap;
    height: 48px;
    /* Match search height */
}

.btn-whatsapp:hover {
    background: #128c7e;
    /* Removed transform translateY */
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

.btn-whatsapp i {
    font-size: 18px;
}

/* Sub Navigation */
.header-nav {
    background: #fff;
    border-top: 1px solid #f9f9f9;
}

.nav-menu {
    display: flex;
    list-style: none;
    margin-left: -15px;
}

.nav-menu>li {
    position: relative;
}

.nav-menu>li>a {
    padding: 12px 15px;
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #4a4a4a;
    transition: var(--transition);
}

.nav-menu>li:hover>a {
    color: var(--primary-orange);
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    min-width: 200px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    border-radius: 0 0 8px 8px;
    padding: 8px 0;
    z-index: 100;
}

.dropdown-content a {
    padding: 10px 20px;
    display: block;
    font-size: 14px;
    color: #555;
    transition: var(--transition);
}

.dropdown-content a:hover {
    background: #fff8f0;
    color: var(--primary-orange);
}

.has-dropdown:hover .dropdown-content {
    display: block;
}

/* Breadcrumb */
.breadcrumb {
    font-size: 12px;
    color: #999;
}

.breadcrumb a:hover {
    color: var(--primary-orange);
}

/* --- Product System --- */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 30px;
}

.product-card {
    background: var(--white);
    border: 1px solid #f2f2f2;
    border-radius: 12px;
    overflow: hidden;
    transition: var(--transition);
    text-align: center;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-5px);
    border-color: #eee;
}

.img-container {
    padding: 0;
    height: 240px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: #fafafa;
}

.img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.discount-tag {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--red-badge);
    color: #fff;
    padding: 3px 6px;
    border-radius: 4px;
    font-weight: 800;
    font-size: 11px;
    z-index: 5;
}

.oos-tag {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #ff3b30;
    /* Vibrant iOS style red */
    color: #fff;
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: 800;
    font-size: 16px;
    z-index: 10;
    text-transform: uppercase;
    white-space: nowrap;
    letter-spacing: 1.5px;
    box-shadow: 0 8px 25px rgba(255, 59, 48, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(4px);
}

.product-card.is-oos .img-container img {
    opacity: 0.5;
    filter: grayscale(1);
}

.product-info {
    padding: 15px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-title {
    font-size: 14px;
    color: var(--text-dark);
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 8px;
    height: 40px;
    overflow: hidden;
}

.stars {
    color: #ffc107;
    font-size: 10px;
    margin-bottom: 12px;
}

.price-box {
    margin-bottom: 10px;
}

.old-price {
    color: #b0b0b0;
    text-decoration: line-through;
    font-size: 12px;
    margin-right: 6px;
}

.current-price {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-dark);
}

.delivery-info {
    font-size: 11px;
    color: var(--primary-orange);
    font-weight: 700;
    margin-top: auto;
}

/* --- Product Detail MODERN SELECT --- */
.modern-select {
    border: 2px solid #f0f0f0;
    transition: var(--transition);
}

.modern-select:focus {
    border-color: var(--primary-orange) !important;
    box-shadow: 0 0 0 4px rgba(243, 132, 0, 0.1);
    background: #fff;
}

.modern-select:hover {
    border-color: #e0e0e0;
}

.product-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
}

.detail-img-wrapper {
    position: relative;
    /* Added for OOS tag positioning */
    background: transparent;
    border: none;
    border-radius: 12px;
    padding: 0;
}

.price-container {
    background: #fdf8f2;
    padding: 24px;
    border-radius: 12px;
    margin: 20px 0;
}

.btn-buy {
    background: var(--primary-orange);
    color: white !important;
    padding: 15px 30px;
    border-radius: 8px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-buy:hover {
    background: var(--hover-orange);
    box-shadow: 0 4px 15px rgba(243, 132, 0, 0.2);
}

/* --- Footer --- */
footer {
    background: #1a1a1a;
    color: #fff;
    padding: 60px 0 30px;
    margin-top: 80px;
}

footer h3 {
    margin-bottom: 20px;
    color: #fff;
}

footer p {
    color: #bbb;
    font-size: 14px;
    line-height: 1.6;
}

footer a {
    color: #bbb;
    font-size: 14px;
}

footer a:hover {
    color: var(--primary-orange);
}

/* Main Header Flex */
/* Wrapper .header-actions removed */

@media (max-width: 900px) {
    .product-detail {
        grid-template-columns: 1fr;
    }

    .header-top {
        padding: 15px 0 10px;
    }

    .header-flex {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        /* Logo Left, WA Left/Right distributed */
        gap: 10px;
        padding-bottom: 5px;
        width: 100%;
        max-width: 100vw;
    }

    .logo {
        height: 40px;
        flex: 0 0 auto;
        order: 1;
    }

    .logo img {
        height: 40px;
    }

    /* WhatsApp Button - Order 2 to sit next to Logo */
    .btn-whatsapp {
        order: 2;
        width: 42px;
        height: 42px;
        padding: 0;
        justify-content: center;
        border-radius: 8px;
        /* Square with rounded corners */
        flex-shrink: 0;
        box-shadow: 0 4px 10px rgba(37, 211, 102, 0.3);
    }

    .btn-whatsapp span {
        display: none;
    }

    .btn-whatsapp i {
        font-size: 20px;
        margin: 0;
    }

    /* Search Form - Order 3 to drop below */
    .search-form {
        order: 3;
        width: 100%;
        flex: 0 0 100%;
        /* Force full width */
        margin: 5px 0 0 0;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    }

    .search-form input {
        border-radius: 8px 0 0 8px;
        height: 42px;
    }

    .search-form button {
        border-radius: 0 8px 8px 0;
        width: 50px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0;
    }


    /* Nav Styling Improvements */
    .header-nav {
        background: #fff;
        border-bottom: 1px solid #f0f0f0;
        padding: 0;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
        overflow: hidden;
        /* Prevent vertical scroll if any */
    }

    .header-nav .container {
        padding: 0;
        max-width: 100%;
    }

    .nav-menu {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 12px;
        padding: 12px 15px;
        /* Comfortable padding */
        margin: 0;
        scrollbar-width: none;
        /* Firefox */
        scroll-behavior: smooth;
    }

    .nav-menu::-webkit-scrollbar {
        display: none;
        /* Chrome/Safari */
    }

    .nav-menu>li {
        flex: 0 0 auto;
    }

    .nav-menu>li:last-child {
        padding-right: 20px;
        /* End buffer */
    }

    .nav-menu>li>a {
        padding: 10px 20px;
        background: #f8fafc;
        border-radius: 20px;
        font-size: 13px;
        color: #64748b;
        font-weight: 600;
        border: 1px solid #e2e8f0;
        white-space: nowrap;
        display: block;
        transition: all 0.2s active;
    }

    .nav-menu>li>a:hover,
    .nav-menu>li>a:active {
        background: #fff7ed;
        color: var(--primary-orange);
        border-color: var(--primary-orange);
        transform: translateY(-1px);
    }
}