:root {
    --wa-green: #128c7e;
    --wa-green-light: #25d366;
    --wa-dark: #075e54;
    --bg-color: #efeae2; /* WhatsApp chat native bg color */
    --card-bg: #ffffff;
    --text-main: #111b21;
    --text-muted: #667781;
    --border-color: #e9edef;
    --danger: #ef4444;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    /* Add subtle WhatsApp pattern */
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M20 20c0-11 9-20 20-20h20c11 0 20 9 20 20v20c0 11-9 20-20 20H40c-11 0-20-9-20-20V20zm-5 40c0-13.8 11.2-25 25-25h20c13.8 0 25 11.2 25 25v20c0 13.8-11.2 25-25 25H40c-13.8 0-25-11.2-25-25V60z' fill='%23d1d7db' fill-opacity='0.15' fill-rule='evenodd'/%3E%3C/svg%3E");
}

/* Public site layout - only for public pages */
body:not(#admin-page) {
    padding-bottom: 120px;
}

/* Prevent style.css from affecting admin */
#admin-page .top-search-bar,
#admin-page .site-footer,
#admin-page .site-search-wrapper {
    display: none !important;
}


button:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 3px solid rgba(37, 211, 102, 0.5);
    outline-offset: 2px;
}

.top-search-bar {
    background: white;
    position: sticky;
    top: 58px;
    z-index: 99;
    padding: 10px 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.site-search-wrapper {
    display: flex;
    align-items: center;
    max-width: 780px;
    margin: 0 auto;
    gap: 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    padding: 8px 12px;
}

.site-search-wrapper input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 10px 12px;
    font-size: 0.98rem;
    color: var(--text-main);
}

.site-search-wrapper input::placeholder {
    color: #94a3b8;
}

.site-search-wrapper button {
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 1rem;
    cursor: pointer;
}

.ad-banner {
    display: none;
    background: linear-gradient(90deg, rgba(18,140,126,0.96), rgba(37,211,102,0.95));
    color: white;
    padding: 10px 0;
    overflow: hidden;
    position: relative;
}

.ad-banner-text {
    display: inline-block;
    white-space: nowrap;
    padding-left: 100%;
    animation: slide-text 18s linear infinite;
}

@keyframes slide-text {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

.site-footer {
    max-width: 1200px;
    margin: 40px auto 20px auto;
    padding: 30px 20px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.site-footer h3,
.site-footer h4 {
    margin-bottom: 12px;
    color: var(--wa-dark);
}

.site-footer p,
.site-footer a {
    color: #475569;
    line-height: 1.7;
}

.site-footer a {
    text-decoration: none;
}

.footer-copy {
    text-align: center;
    color: #64748b;
    font-size: 0.95rem;
}

@media (max-width: 720px) {
    .top-nav {
        flex-wrap: wrap;
        gap: 10px;
        align-items: stretch;
    }
    .top-search-bar {
        top: 120px;
    }
    .products-container {
        grid-template-columns: repeat(auto-fill, minmax(100%, 1fr));
    }
}

/* Header */
.top-nav {
    background-color: var(--wa-dark);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.shop-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.shop-avatar img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid white;
}

.shop-text h1 {
    font-size: 1.1rem;
    font-weight: 600;
}

.shop-text p {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.8);
}

.icon-btn {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.2rem;
    position: relative;
    cursor: pointer;
}

#cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: var(--wa-green-light);
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 4px;
}

/* Categories */
.categories-wrapper {
    background: white;
    padding: 12px 0;
    position: sticky;
    top: 66px;
    z-index: 99;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.categories-scroll {
    display: flex;
    overflow-x: auto;
    padding: 0 20px;
    gap: 10px;
    scrollbar-width: none; /* Firefox */
}

.categories-scroll::-webkit-scrollbar {
    display: none; /* Chrome */
}

.cat-pill {
    white-space: nowrap;
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    background: white;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.cat-pill.active {
    background: var(--wa-green-light);
    color: white;
    border-color: var(--wa-green-light);
}

/* Products Layout */
.products-container {
    padding: 15px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 15px;
    max-width: 1200px;
    margin: 0 auto;
}

.product-card {
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
}

.product-img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    background: #f0f0f0;
}

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

.product-name {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--text-main);
}

.product-price {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--wa-dark);
    margin-bottom: 12px;
}

.add-btn {
    margin-top: auto;
    background: white;
    border: 1px solid var(--wa-green);
    color: var(--wa-green);
    padding: 8px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.add-btn:active {
    background: var(--wa-green-light);
    color: white;
}

/* Cart Bottom Sheet Simulator */
.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.cart-overlay.show {
    opacity: 1;
    pointer-events: all;
}

.cart-bottom-sheet {
    position: fixed;
    bottom: -100%;
    left: 0;
    width: 100%;
    max-height: 85vh;
    background: white;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    z-index: 1001;
    display: flex;
    flex-direction: column;
    transition: bottom 0.3s ease-in-out;
    box-shadow: 0 -5px 15px rgba(0,0,0,0.1);
}

.cart-bottom-sheet.show {
    bottom: 0;
}

/* For Desktop - constrain sheet */
@media (min-width: 768px) {
    .cart-bottom-sheet {
        width: 400px;
        left: auto;
        right: 20px;
        bottom: -100%;
        border-radius: 20px;
        max-height: 80vh;
    }
    .cart-bottom-sheet.show {
        bottom: 20px;
    }
}

.cart-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-header h2 {
    font-size: 1.2rem;
    color: var(--text-main);
}

.close-btn {
    color: var(--text-muted);
    font-size: 1.5rem;
}

.cart-items {
    padding: 15px 20px;
    overflow-y: auto;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.cart-item {
    display: flex;
    align-items: center;
    gap: 15px;
}

.cart-item img {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    object-fit: cover;
}

.cart-item-details {
    flex-grow: 1;
}

.cart-item-details h4 {
    font-size: 0.9rem;
    margin-bottom: 3px;
}

.cart-item-details p {
    font-size: 0.85rem;
    color: var(--wa-dark);
    font-weight: 600;
}

.qty-control {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f0f2f5;
    border-radius: 20px;
    padding: 4px;
}

.qty-btn {
    background: white;
    border: none;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    font-weight: bold;
    color: var(--wa-dark);
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.cart-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    background: #f0f2f5;
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
}

.cart-total-row {
    display: flex;
    justify-content: space-between;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 15px;
}

.wa-btn {
    width: 100%;
    background: var(--wa-green-light);
    color: white;
    border: none;
    padding: 14px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(37, 211, 102, 0.4);
}

.wa-btn:active {
    background: var(--wa-green);
}

.empty-cart {
    text-align: center;
    color: var(--text-muted);
    padding: 40px 0;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--text-main);
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 0.9rem;
    transition: transform 0.3s;
    z-index: 2000;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

/* Modals */
.modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); display: none; justify-content: center; align-items: center; z-index: 1000; }
.modal.show { display: flex; }
.modal-card { background: white; width: 90%; max-width: 500px; padding: 30px; border-radius: 15px; box-shadow: 0 10px 25px rgba(0,0,0,0.2); }
.form-group { margin-bottom: 15px; }
.form-group label { display: block; margin-bottom: 5px; font-weight: 500; font-size: 0.9rem; }
.form-group input { width: 100%; padding: 12px; border: 1px solid #ccc; border-radius: 6px; font-family: inherit; font-size:1rem; box-sizing: border-box; }

.pay-method-card { flex: 1; border: 2px solid #e9edef; border-radius: 10px; text-align: center; padding: 10px 5px; cursor: pointer; font-weight: 600; font-size: 0.9rem; transition: 0.2s; color: #666; }
.pay-method-card.active { border-color: var(--wa-green); background: #e0f2fe; color: var(--wa-dark); }
.product-card { position: relative; overflow: hidden; }

/* Custom Added Styles for Logo and Chatbot */
header.main-hero-banner {
    text-align: center;
    padding: 60px 20px 40px;
    background: linear-gradient(rgba(18, 140, 126, 0.4), rgba(7, 94, 84, 0.8)), url('images/hero_bg.png');
    background-size: cover;
    background-position: center;
    box-shadow: inset 0 -10px 20px rgba(0,0,0,0.2);
}
header.main-hero-banner img#store-logo {
    max-width: 120px;
    max-height: 120px;
    object-fit: contain;
    border-radius: 50%;
    display: block;
    margin: 5px auto;
    border: 3px solid white;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}
header.main-hero-banner h1#store-name-title {
    text-align: center;
    font-size: 2.2rem;
    color: white;
    margin-top: 15px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.6);
    font-weight: 700;
}
header.main-hero-banner p.store-tagline {
    color: rgba(255,255,255,0.95);
    font-size: 1.1rem;
    margin-top: 8px;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
    font-weight: 500;
}

/* Chatbot Floating UI */
#chatbot-btn {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 60px;
    height: 60px;
    background-color: var(--wa-green-light);
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.8rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    z-index: 9999;
    transition: transform 0.2s, box-shadow 0.2s;
}

#chatbot-btn:hover {
    transform: scale(1.05) translateY(-5px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.4);
}

#chatbot-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background-color: red;
    color: white;
    font-size: 0.8rem;
    font-weight: bold;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 2px solid white;
}

#chatbot-window {
    position: fixed;
    bottom: 100px;
    right: 25px;
    width: 340px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
    z-index: 10000;
    display: none;
    flex-direction: column;
    overflow: hidden;
    transform-origin: bottom right;
    animation: chatPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid #e9edef;
}

@keyframes chatPop {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

#chatbot-header {
    background: var(--wa-dark);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#chatbot-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

#chatbot-avatar {
    width: 38px;
    height: 38px;
    background: white;
    color: var(--wa-dark);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.3rem;
}

#chatbot-close {
    cursor: pointer;
    font-size: 1.5rem;
    color: rgba(255,255,255,0.8);
    transition: color 0.2s;
}

#chatbot-close:hover {
    color: white;
}

#chatbot-messages {
    padding: 20px;
    height: 320px;
    overflow-y: auto;
    background: var(--bg-color);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-msg {
    padding: 12px 15px;
    border-radius: 12px;
    max-width: 85%;
    font-size: 0.95rem;
    line-height: 1.4;
    position: relative;
    word-wrap: break-word;
}

.chat-bot {
    background: white;
    align-self: flex-start;
    border-top-left-radius: 0;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    color: var(--text-main);
}

.chat-user {
    background: #dcf8c6;
    align-self: flex-end;
    border-top-right-radius: 0;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    color: var(--text-main);
}

.chat-opt {
    display: block;
    width: 100%;
    text-align: left;
    background: white;
    border: 1px solid var(--wa-green);
    color: var(--wa-green);
    padding: 10px 15px;
    border-radius: 20px;
    margin-top: 10px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
}

.chat-opt:hover {
    background: var(--wa-green);
    color: white;
}

#chatbot-input-area {
    display: flex;
    padding: 15px;
    background: white;
    gap: 10px;
}

#chatbot-input {
    flex: 1;
    border: none;
    background: #f0f2f5;
    padding: 12px 18px;
    border-radius: 25px;
    font-size: 0.95rem;
    outline: none;
    color: var(--text-main);
}

#chatbot-send {
    background: var(--wa-green-light);
    color: white;
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background 0.2s;
}

#chatbot-send:hover {
    background: var(--wa-green);
}

