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

:root {
    --green: #19a463;
    --green-dark: #087443;
    --green-light: #e8f8f0;

    --orange: #ff9f43;
    --red: #ff5b5b;

    --bg: #f6f8f7;
    --white: #ffffff;
    --text: #17211d;
    --muted: #7a8580;
    --border: #e6ebe8;

    --shadow: 0 15px 45px rgba(20, 50, 35, .08);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: Inter, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    overflow-x: hidden;
}

button,
input {
    font-family: inherit;
}

button {
    cursor: pointer;
}

a {
    color: inherit;
}

/* =========================
   HEADER
========================= */

header {
    position: sticky;
    top: 0;
    z-index: 1000;

    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(18px);

    border-bottom: 1px solid rgba(0, 0, 0, .05);
}

.header-inner {
    max-width: 1400px;
    margin: auto;

    height: 78px;

    padding: 0 25px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 25px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text);
    flex-shrink: 0;
}

.logo-icon {
    width: 45px;
    height: 45px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: linear-gradient(135deg, var(--green), var(--green-dark));

    color: white;
    border-radius: 14px;

    font-size: 22px;

    box-shadow: 0 8px 20px rgba(25, 164, 99, .25);
}

.logo-text strong {
    display: block;
    font-size: 16px;
    font-weight: 900;
    letter-spacing: -.3px;
}

.logo-text span {
    font-size: 11px;
    color: var(--muted);
}

.search {
    flex: 1;
    max-width: 520px;
    position: relative;
}

.search input {
    width: 100%;
    height: 46px;

    border: 1px solid var(--border);
    border-radius: 14px;

    outline: none;

    padding: 0 18px 0 45px;

    background: #f7f9f8;

    font-size: 14px;

    transition: .25s;
}

.search input:focus {
    background: white;
    border-color: var(--green);
    box-shadow: 0 0 0 4px rgba(25, 164, 99, .08);
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 17px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cart-button {
    position: relative;

    border: none;

    background: var(--green);
    color: white;

    height: 48px;

    padding: 0 18px;

    border-radius: 15px;

    font-weight: 800;

    display: flex;
    align-items: center;
    gap: 9px;

    box-shadow: 0 8px 20px rgba(25, 164, 99, .2);

    transition: .25s;
}

.cart-button:hover {
    transform: translateY(-2px);
    background: var(--green-dark);
}

#cartCount {
    background: white;
    color: var(--green-dark);

    min-width: 23px;
    height: 23px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    font-size: 12px;
}

/* =========================
   HERO
========================= */

.hero {
    max-width: 1400px;
    margin: auto;

    padding: 55px 25px 25px;
}

.hero-box {
    min-height: 330px;

    border-radius: 32px;

    padding: 50px;

    position: relative;
    overflow: hidden;

    background:
        radial-gradient(circle at 90% 10%, rgba(255, 255, 255, .35), transparent 30%),
        linear-gradient(120deg, #087443, #19a463 55%, #45bd80);

    color: white;

    display: flex;
    align-items: center;
}

.hero-content {
    max-width: 620px;
    position: relative;
    z-index: 2;

    animation: heroIn .8s ease both;
}

.hero-badge {
    display: inline-flex;

    padding: 8px 13px;

    background: rgba(255, 255, 255, .16);

    border: 1px solid rgba(255, 255, 255, .2);

    border-radius: 100px;

    font-size: 12px;
    font-weight: 700;

    margin-bottom: 18px;
}

.hero h1 {
    font-size: clamp(36px, 5vw, 62px);
    line-height: .98;

    letter-spacing: -3px;

    margin-bottom: 20px;
}

.hero p {
    max-width: 520px;

    color: rgba(255, 255, 255, .82);

    line-height: 1.6;

    font-size: 15px;
}

.hero-decoration {
    position: absolute;

    right: 5%;
    bottom: -80px;

    width: 380px;
    height: 380px;

    border-radius: 50%;

    background: rgba(255, 255, 255, .08);

    animation: floating 5s ease-in-out infinite;
}

.hero-decoration::after {
    content: "🛒";

    position: absolute;

    font-size: 150px;

    left: 95px;
    top: 80px;

    filter: drop-shadow(0 15px 15px rgba(0, 0, 0, .12));
}

/* =========================
   CATEGORIES
========================= */

.categories {
    max-width: 1400px;
    margin: auto;

    padding: 25px;
}

.category-list {
    display: flex;
    gap: 10px;

    overflow-x: auto;

    scrollbar-width: none;
}

.category-list::-webkit-scrollbar {
    display: none;
}

.category {
    flex-shrink: 0;

    border: 1px solid var(--border);

    background: white;

    padding: 12px 17px;

    border-radius: 100px;

    font-size: 13px;
    font-weight: 700;

    transition: .25s;
}

.category:hover,
.category.active {
    background: var(--green);
    color: white;
    border-color: var(--green);

    transform: translateY(-2px);
}

/* =========================
   PRODUCTS
========================= */

.products-section {
    max-width: 1400px;
    margin: auto;

    padding: 10px 25px 120px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;

    margin: 15px 0 25px;
}

.section-header h2 {
    font-size: 28px;
    letter-spacing: -1px;
}

.products-count {
    color: var(--muted);
    font-size: 13px;
}

.products {
    display: grid;

    grid-template-columns: repeat(4, minmax(0, 1fr));

    gap: 18px;
}

.product {
    background: white;

    border: 1px solid var(--border);

    border-radius: 22px;

    overflow: hidden;

    position: relative;

    transition: transform .3s ease, box-shadow .3s ease;

    animation: productIn .6s ease both;
}

.product:hover {
    transform: translateY(-7px);

    box-shadow: var(--shadow);
}

.product-image {
    height: 210px;

    background: linear-gradient(135deg, #f3f6f4, #e9f2ed);

    display: flex;
    align-items: center;
    justify-content: center;

    position: relative;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;

    object-fit: cover;

    transition: transform .5s;

    position: relative;
    z-index: 1;
}

.product-emoji {
    position: absolute;
    font-size: 58px;
    opacity: .55;
}

.product:hover .product-image img {
    transform: scale(1.05);
}

.product-tag {
    position: absolute;

    top: 12px;
    left: 12px;

    padding: 6px 9px;

    border-radius: 8px;

    background: white;

    color: var(--green-dark);

    font-size: 10px;
    font-weight: 900;

    z-index: 2;

    box-shadow: 0 5px 15px rgba(0, 0, 0, .08);
}

.product-stock {
    position: absolute;

    top: 12px;
    right: 12px;

    padding: 6px 9px;

    border-radius: 8px;

    background: rgba(23, 33, 29, .8);

    color: white;

    font-size: 10px;
    font-weight: 800;

    z-index: 2;
}

.product-stock.low {
    background: rgba(255, 159, 67, .95);
}

.product-stock.out {
    background: rgba(255, 91, 91, .95);
}

.product-info {
    padding: 17px;
}

.product-category {
    color: var(--green);
    font-size: 11px;
    font-weight: 800;

    text-transform: uppercase;

    margin-bottom: 7px;
}

.product-name {
    font-size: 16px;
    font-weight: 800;

    margin-bottom: 8px;

    min-height: 38px;
}

.product-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;

    gap: 10px;
}

.price {
    font-size: 19px;
    font-weight: 900;
}

.unit {
    color: var(--muted);
    font-size: 11px;
    margin-top: 2px;
}

.wholesale-hint {
    color: var(--green-dark);
    background: var(--green-light);
    border-radius: 7px;

    display: inline-block;

    margin-top: 7px;
    padding: 4px 7px;

    font-size: 10px;
    font-weight: 800;
}

.add-btn {
    width: 43px;
    height: 43px;

    border: none;

    border-radius: 13px;

    background: var(--green-light);

    color: var(--green-dark);

    font-size: 22px;
    font-weight: 800;

    transition: .2s;

    flex-shrink: 0;
}

.add-btn:hover {
    background: var(--green);
    color: white;

    transform: rotate(90deg);
}

.add-btn:disabled {
    background: #f1f3f2;
    color: var(--muted);
    cursor: not-allowed;
    transform: none;
}

.quantity {
    display: none;

    align-items: center;

    gap: 8px;
}

.quantity button {
    width: 31px;
    height: 31px;

    border: none;

    border-radius: 9px;

    background: #edf3ef;

    font-size: 18px;

    transition: .2s;
}

.quantity button:hover {
    background: var(--green);
    color: white;
}

.quantity span {
    min-width: 20px;
    text-align: center;
    font-weight: 800;
}

/* =========================
   LOADING / EMPTY / ERROR
========================= */

.skeleton-card {
    height: 340px;
    border-radius: 22px;
    background: linear-gradient(100deg, #eef2ef 30%, #f7faf8 50%, #eef2ef 70%);
    background-size: 300% 100%;
    animation: shimmer 1.3s infinite;
}

.empty-products,
.error-box {
    grid-column: 1 / -1;

    padding: 55px 20px;

    text-align: center;

    background: white;

    border: 1px dashed var(--border);
    border-radius: 22px;

    color: var(--muted);

    font-size: 14px;
}

.error-box strong {
    display: block;
    color: var(--text);
    margin-bottom: 7px;
}

.error-box button {
    margin-top: 15px;

    border: none;
    background: var(--green);
    color: white;

    padding: 10px 18px;
    border-radius: 11px;

    font-weight: 800;
}

/* =========================
   CART DRAWER
========================= */

.cart-overlay {
    position: fixed;

    inset: 0;

    background: rgba(0, 0, 0, .35);

    backdrop-filter: blur(5px);

    opacity: 0;
    visibility: hidden;

    transition: .3s;

    z-index: 2000;
}

.cart-overlay.active {
    opacity: 1;
    visibility: visible;
}

.cart {
    position: absolute;

    right: 0;
    top: 0;

    height: 100%;

    width: min(430px, 100%);

    background: white;

    transform: translateX(100%);

    transition: .4s cubic-bezier(.77, 0, .18, 1);

    display: flex;
    flex-direction: column;

    box-shadow: -20px 0 60px rgba(0, 0, 0, .15);
}

.cart-overlay.active .cart {
    transform: translateX(0);
}

.cart-header {
    padding: 23px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    border-bottom: 1px solid var(--border);
}

.cart-header h3 {
    font-size: 21px;
}

.close-cart {
    width: 38px;
    height: 38px;

    border: none;

    background: #f3f5f4;

    border-radius: 12px;

    font-size: 20px;
}

.cart-items {
    flex: 1;

    overflow-y: auto;

    padding: 20px;
}

.empty-cart {
    height: 100%;

    display: flex;
    align-items: center;
    justify-content: center;

    text-align: center;

    color: var(--muted);
}

.empty-cart div {
    max-width: 250px;
}

.empty-icon {
    font-size: 60px;
    margin-bottom: 15px;
}

.cart-item {
    display: flex;

    gap: 12px;

    padding: 13px 0;

    border-bottom: 1px solid var(--border);

    animation: cartItemIn .3s ease;
}

.cart-item-image {
    width: 65px;
    height: 65px;

    border-radius: 12px;

    overflow: hidden;

    background: #f2f5f3;

    flex-shrink: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 27px;
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-item-info {
    flex: 1;
}

.cart-item-name {
    font-size: 13px;
    font-weight: 800;

    margin-bottom: 5px;
}

.cart-item-price {
    font-size: 13px;
    color: var(--green-dark);
    font-weight: 800;
}

.cart-item-price small {
    display: block;
    color: var(--muted);
    font-size: 10px;
    font-weight: 600;
    margin-top: 2px;
}

.cart-item-controls {
    display: flex;
    align-items: center;

    gap: 6px;

    margin-top: 7px;
}

.cart-item-controls button {
    width: 25px;
    height: 25px;

    border: none;

    background: #eef3f0;

    border-radius: 7px;
}

.cart-footer {
    padding: 20px;

    border-top: 1px solid var(--border);

    background: white;
}

.total {
    display: flex;
    justify-content: space-between;

    margin-bottom: 15px;
}

.total span:first-child {
    color: var(--muted);
}

.total strong {
    font-size: 22px;
}

.customer-form {
    display: grid;
    gap: 9px;

    margin-bottom: 15px;
}

.customer-form input {
    width: 100%;
    height: 44px;

    border: 1px solid var(--border);
    border-radius: 12px;

    padding: 0 13px;

    outline: none;

    font-size: 13px;

    transition: .2s;
}

.customer-form input:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(25, 164, 99, .08);
}

.form-note {
    color: var(--muted);
    font-size: 11px;
    line-height: 1.5;
}

.order-btn {
    width: 100%;

    height: 56px;

    border: none;

    border-radius: 16px;

    background: #25D366;

    color: white;

    font-size: 15px;
    font-weight: 900;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;

    transition: .25s;
}

.order-btn:hover {
    background: #1db954;
    transform: translateY(-2px);

    box-shadow: 0 10px 25px rgba(37, 211, 102, .25);
}

.order-btn:disabled {
    opacity: .5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* =========================
   FLYING PRODUCT
========================= */

.flying-product {
    position: fixed;

    width: 55px;
    height: 55px;

    border-radius: 14px;

    object-fit: cover;

    z-index: 5000;

    pointer-events: none;

    transition: left .7s cubic-bezier(.2, .8, .2, 1),
        top .7s cubic-bezier(.2, .8, .2, 1),
        width .7s, height .7s, opacity .7s, transform .7s;

    box-shadow: 0 10px 30px rgba(0, 0, 0, .2);
}

/* =========================
   TOAST
========================= */

.toast {
    position: fixed;

    left: 50%;
    bottom: 30px;

    transform: translate(-50%, 100px);

    background: #17211d;

    color: white;

    padding: 13px 18px;

    border-radius: 14px;

    font-size: 13px;
    font-weight: 700;

    z-index: 6000;

    opacity: 0;

    transition: .35s;

    max-width: min(560px, calc(100% - 30px));

    text-align: center;
}

.toast.show {
    opacity: 1;

    transform: translate(-50%, 0);
}

.toast.error {
    background: #d63c3c;
}

/* =========================
   ANIMATIONS
========================= */

@keyframes heroIn {
    from {
        opacity: 0;
        transform: translateY(25px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes productIn {
    from {
        opacity: 0;
        transform: translateY(25px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes cartItemIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes floating {
    0%, 100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-20px);
    }
}

@keyframes shimmer {
    from {
        background-position: 100% 0;
    }

    to {
        background-position: -100% 0;
    }
}

/* =========================
   RESPONSIVE
========================= */

@media(max-width: 1050px) {

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

    .hero-decoration {
        opacity: .5;
    }
}

@media(max-width: 750px) {

    .header-inner {
        height: auto;

        padding: 13px 15px;

        flex-wrap: wrap;
    }

    .search {
        order: 3;

        flex-basis: 100%;

        max-width: none;
    }

    .hero {
        padding: 20px 15px;
    }

    .hero-box {
        padding: 32px 25px;

        min-height: 300px;

        border-radius: 25px;
    }

    .hero h1 {
        font-size: 42px;
    }

    .hero-decoration {
        right: -150px;
    }

    .categories {
        padding: 10px 15px 20px;
    }

    .products-section {
        padding-left: 15px;
        padding-right: 15px;
    }

    .products {
        grid-template-columns: repeat(2, minmax(0, 1fr));

        gap: 12px;
    }

    .product {
        border-radius: 17px;
    }

    .product-image {
        height: 170px;
    }

    .product-info {
        padding: 13px;
    }

    .product-name {
        font-size: 14px;
    }

    .price {
        font-size: 16px;
    }
}

@media(max-width: 430px) {

    .logo-text span {
        display: none;
    }

    .cart-button {
        padding: 0 12px;
    }

    .products {
        gap: 9px;
    }

    .product-image {
        height: 145px;
    }

    .product-bottom {
        align-items: flex-end;
    }

    .quantity button {
        width: 28px;
        height: 28px;
    }
}
