/* ==========================================================================
   1. DESIGN TOKENS & CSS VARIABLES
   ========================================================================== */
:root {
    --surface: #ffffff;
    --surface-subtle: #f8f9fa;
    --primary: #1a73e8;
    --primary-hover: #1557b0;
    --text-main: #202124;
    --text-muted: #5f6368;
    --border: #dadce0;
    --shadow-subtle: 0 1px 3px 0 rgba(60,64,67,0.1), 0 1px 2px 0 rgba(60,64,67,0.06);
    --shadow-hover: 0 4px 8px 0 rgba(60,64,67,0.15), 0 1px 3px 0 rgba(60,64,67,0.1);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   2. BASE & GLOBAL STYLES
   ========================================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

body {
    background-color: var(--surface-subtle);
    color: var(--text-main);
    line-height: 1.6;
}

/* ==========================================================================
   3. HEADER & NAVIGATION
   ========================================================================== */
header {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 5%;
    transition: var(--transition);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Borderless Refined Brand Logo */
.logo {
    font-family: 'Google Sans', sans-serif;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-main);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -0.5px;
}
.logo-icon-wrapper {
    background: var(--surface-subtle);
    color: var(--primary);
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}
.logo span {
    color: var(--primary);
}

/* Desktop Navigation Links */
.nav-links {
    display: flex;
    list-style: none;
    align-items: center;
    gap: 24px;
}
.nav-links a {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.9rem;
    transition: var(--transition);
}
.nav-links a:hover {
    color: var(--primary);
}

/* Account Pill Button */
.account-pill-btn {
    background: var(--surface-subtle);
    border: 1px solid var(--border);
    padding: 0.45rem 1rem;
    border-radius: 99px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}
.account-pill-btn:hover {
    border-color: var(--primary);
    background: #e8f0fe;
    color: var(--primary);
}

/* Cart Bag Pill Button */
.cart-btn {
    background: var(--primary);
    color: var(--surface);
    border: none;
    padding: 0.5rem 1.1rem;
    border-radius: 99px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
    box-shadow: 0 4px 12px rgba(26, 115, 232, 0.25);
}
.cart-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}
.cart-btn span {
    background: rgba(255, 255, 255, 0.25);
    padding: 1px 7px;
    border-radius: 99px;
    font-size: 0.75rem;
}

/* Borderless Mobile Menu Toggle Button */
.menu-toggle {
    background: none;
    color: var(--text-main);
    width: 38px;
    height: 38px;
    border-radius: 10px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: var(--transition);
    border: none;
}
.menu-toggle:hover {
    background: var(--surface-subtle);
    color: var(--primary);
}

/* Auth Dropdown Menu */
.auth-dropdown-container {
    position: relative;
}
.auth-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(60,64,67,0.15);
    width: 200px;
    display: none;
    z-index: 101;
    overflow: hidden;
}
.auth-dropdown-menu.show {
    display: block;
}
.auth-dropdown-menu button {
    width: 100%;
    background: none;
    border: none;
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-main);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: var(--transition);
}
.auth-dropdown-menu button:hover {
    background: var(--surface-subtle);
    color: var(--primary);
}
.auth-dropdown-menu button i {
    color: var(--primary);
    width: 16px;
}

/* ==========================================================================
   4. MOBILE SLIDING MENU
   ========================================================================== */
.mobile-menu {
    position: fixed;
    top: 0;
    left: -300px;
    width: 280px;
    height: 100%;
    background: var(--surface);
    box-shadow: 10px 0 30px rgba(60,64,67,0.15);
    z-index: 1050;
    transition: left 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
}
.mobile-menu.open {
    left: 0;
}
.mobile-menu-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.mobile-menu-links {
    list-style: none;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}
.mobile-menu-links a {
    text-decoration: none;
    color: var(--text-main);
    font-weight: 600;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: var(--transition);
}
.mobile-menu-links a:hover {
    color: var(--primary);
}

/* ==========================================================================
   5. HERO & STORE LAYOUT
   ========================================================================== */
.hero {
    background: linear-gradient(135deg, #1a73e8 0%, #4285f4 100%);
    color: #fff;
    text-align: center;
    padding: 4rem 2rem;
    margin-bottom: 2.5rem;
    position: relative;
    overflow: hidden;
}
.hero h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: -0.5px;
}
.hero p {
    font-size: 1.05rem;
    color: #e8f0fe;
    max-width: 600px;
    margin: 0 auto;
}

.container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 24px 5rem 24px;
}
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 1.5rem;
}
.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--text-main);
}
.section-subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ==========================================================================
   6. PRODUCT CATALOG & CARDS
   ========================================================================== */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 2.5rem;
}
.product-card {
    background: var(--surface);
    border-radius: 12px;
    border: 1px solid var(--border);
    overflow: hidden;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: var(--shadow-subtle);
}
.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: #bdc1c6;
}
.product-img-placeholder {
    height: 200px;
    background: #e8f0fe;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 3rem;
    position: relative;
    transition: var(--transition);
}
.product-card:hover .product-img-placeholder {
    background: #d2e3fc;
    color: var(--primary-hover);
}
.badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(32, 33, 36, 0.8);
    backdrop-filter: blur(4px);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
}
.product-info {
    padding: 1.25rem;
}
.product-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: var(--text-main);
}
.product-desc {
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.4;
    margin-bottom: 1rem;
}
.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1.25rem 1.25rem 1.25rem;
}
.price {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-main);
}
.btn-add {
    background: #f8f9fa;
    color: var(--primary);
    border: 1px solid var(--border);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    transition: var(--transition);
}
.btn-add:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* ==========================================================================
   7. CART SLIDE-OUT DRAWER
   ========================================================================== */
.cart-drawer {
    position: fixed;
    top: 0;
    right: -400px;
    width: 380px;
    height: 100%;
    background: var(--surface);
    box-shadow: -10px 0 30px rgba(60,64,67,0.15);
    z-index: 1000;
    transition: right 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
}
.cart-drawer.open {
    right: 0;
}
.cart-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.close-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--text-muted);
}
.cart-body {
    padding: 1.5rem;
    flex: 1;
    overflow-y: auto;
}
.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}
.cart-footer {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--border);
    background: var(--surface-subtle);
}
.total-row {
    display: flex;
    justify-content: space-between;
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 1rem;
}
.checkout-btn {
    width: 100%;
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 0.75rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
}
.checkout-btn:hover {
    background: var(--primary-hover);
}

/* ==========================================================================
   8. MODALS & OVERLAYS
   ========================================================================== */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(32, 33, 36, 0.4);
    backdrop-filter: blur(3px);
    z-index: 900;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.overlay.active {
    display: block;
    opacity: 1;
}

.checkout-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: var(--surface);
    width: 90%;
    max-width: 420px;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    z-index: 1200;
    display: none;
    opacity: 0;
    transition: all 0.3s ease;
    text-align: center;
}
.checkout-modal.active {
    display: block;
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}
.checkout-modal i {
    font-size: 3rem;
    color: #34a853; /* Success Green */
    margin-bottom: 1rem;
}
.checkout-modal h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}
.checkout-modal p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

/* Payment Options List */
.payment-options-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 1.5rem 0;
    text-align: left;
}
.payment-option-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition);
    background: var(--surface-subtle);
}
.payment-option-card:hover {
    border-color: var(--primary);
    background: #e8f0fe;
}
.payment-option-card input[type="radio"] {
    accent-color: var(--primary);
    width: 18px;
    height: 18px;
}
.payment-option-card label {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-main);
    cursor: pointer;
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
}
.payment-option-card label i {
    color: var(--primary);
    font-size: 1.1rem;
}

/* Auth Modal Styles */
.auth-form-group {
    text-align: left;
    margin-bottom: 1.25rem;
}
.auth-form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}
.auth-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition);
}
.auth-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.15);
}
.auth-btn {
    width: 100%;
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 0.75rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 0.5rem;
}
.auth-btn:hover {
    background: var(--primary-hover);
}
.guest-skip {
    display: block;
    margin-top: 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
}
.guest-skip:hover {
    color: var(--primary);
}

/* Demo Success Alert Banner */
.demo-auth-alert {
    background: #e6f4ea;
    color: #137333;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1rem;
    display: none;
    align-items: center;
    gap: 8px;
    border: 1px solid #ceead6;
}

/* ==========================================================================
   9. NOTIFICATIONS & ANIMATIONS
   ========================================================================== */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(120px);
    background: var(--text-main);
    color: var(--surface);
    padding: 0.75rem 1.25rem;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 10px 25px rgba(0,0,0,0.25);
    z-index: 1100;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    align-items: center;
    gap: 15px;
    max-width: 90%;
}
.toast.show {
    transform: translateX(-50%) translateY(0);
}
.toast-msg {
    display: flex;
    align-items: center;
    gap: 8px;
}
.toast-btn {
    background: var(--primary);
    color: var(--surface);
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}
.toast-btn:hover {
    background: var(--primary-hover);
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.25); }
    100% { transform: scale(1); }
}
.pulse {
    animation: pulse 0.3s ease-in-out;
}

/* ==========================================================================
   10. FOOTER
   ========================================================================== */
footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ==========================================================================
   11. RESPONSIVE MEDIA QUERIES
   ========================================================================== */
@media (max-width: 900px) {
    .nav-links {
        display: none;
    }
    .menu-toggle {
        display: flex !important;
    }
    #mobileCartBtn {
        display: flex !important;
        padding: 0.45rem 0.9rem;
        font-size: 0.85rem;
    }
}