/* Reset & Global */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --text-color: #2c3e50;
    --bg-color: #f8fafc;
    --primary-color: #d1112c; /* Premium Red */
    --secondary-color: #1a4f3e; /* Fresh Green */
    --accent-color: #fff;
    --border-color: #e2e8f0;
    --transition: 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

body {
    font-family: 'Noto Sans JP', "Helvetica Neue", Arial, sans-serif;
    color: var(--text-color);
    background-color: var(--bg-color);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Header */
.header {
    background: #fff;
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-color);
}

.cart-icon-wrapper {
    position: relative;
    cursor: pointer;
    font-size: 24px;
    color: #333;
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -10px;
    background: var(--primary-color);
    color: #fff;
    font-size: 12px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 50%;
}

/* Product Grid */
.container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

.section-title {
    text-align: center;
    margin-bottom: 40px;
    font-size: 28px;
    color: #222;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 30px;
}

.product-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: var(--transition);
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.product-img {
    width: 100%;
    height: 200px;
    background: #eee;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.product-img span {
    color: #aaa;
    font-size: 14px;
}

.product-info {
    padding: 20px;
}

.product-title {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 10px;
    color: #333;
}

.product-price {
    font-size: 18px;
    color: var(--primary-color);
    font-weight: bold;
    margin-bottom: 20px;
}

.btn-add {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 6px;
    background: #222;
    color: #fff;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition);
}

.btn-add:hover {
    background: var(--primary-color);
}

/* Cart Sidebar */
.cart-sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: #fff;
    box-shadow: -5px 0 15px rgba(0,0,0,0.1);
    z-index: 1000;
    transition: 0.4s ease-in-out;
    display: flex;
    flex-direction: column;
}

.cart-sidebar.open {
    right: 0;
}

.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: 20px;
}

.close-cart {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.cart-item {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.cart-item-img {
    width: 60px;
    height: 60px;
    background: #f0f0f0;
    border-radius: 8px;
}

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

.cart-item-title {
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 5px;
}

.cart-item-price {
    color: var(--primary-color);
    font-weight: bold;
}

.cart-item-remove {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 12px;
    text-decoration: underline;
}

.cart-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    background: #f9f9f9;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 20px;
}

.btn-checkout {
    width: 100%;
    padding: 15px;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition);
}

.btn-checkout:hover {
    background: #b80710;
}

/* Overlay for sidebar */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: 0.3s;
}

.overlay.show {
    opacity: 1;
    visibility: visible;
}

/* Responsive */
@media (max-width: 768px) {
    .cart-sidebar {
        width: 100%;
        right: -100%;
    }
}

/* -----------------------------
   Auth UI Styles
----------------------------- */
.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.auth-ui {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-auth {
    padding: 8px 16px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    border: 1px solid var(--primary-color);
    transition: var(--transition);
}

.btn-login {
    background: transparent;
    color: var(--primary-color);
}

.btn-login:hover {
    background: rgba(229, 9, 20, 0.1);
}

.btn-register {
    background: var(--primary-color);
    color: #fff;
}

.btn-register:hover {
    background: #b80710;
}

.btn-logout {
    background: transparent;
    color: #666;
    border: 1px solid #ccc;
    font-size: 12px;
    padding: 6px 12px;
}

.btn-logout:hover {
    background: #f0f0f0;
}

.user-email {
    font-size: 14px;
    color: #555;
    margin-right: 5px;
}

/* Auth Screens */
.auth-container {
    max-width: 400px;
    margin: 60px auto;
    background: #fff;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.auth-title {
    text-align: center;
    margin-bottom: 30px;
    color: #222;
    font-size: 24px;
}

.auth-form .form-group {
    margin-bottom: 20px;
}

.auth-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #555;
    font-size: 14px;
}

.auth-form input[type="email"],
.auth-form input[type="password"] {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 16px;
}

.auth-form input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(229, 9, 20, 0.2);
}

.btn-submit {
    width: 100%;
    padding: 14px;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 10px;
}

.btn-submit:hover {
    background: #b80710;
}

.auth-links {
    margin-top: 20px;
    text-align: center;
    font-size: 14px;
}

.auth-links a {
    color: var(--primary-color);
    text-decoration: none;
    margin: 0 5px;
}

.auth-links a:hover {
    text-decoration: underline;
}

.auth-error {
    color: #d32f2f;
    background: #ffebee;
    padding: 10px;
    border-radius: 4px;
    font-size: 14px;
    margin-bottom: 20px;
    display: none;
}
.auth-success {
    color: #2e7d32;
    background: #e8f5e9;
    padding: 10px;
    border-radius: 4px;
    font-size: 14px;
    margin-bottom: 20px;
    display: none;
}

/* -----------------------------
   Premium UI Enhancements (Soctoc Style)
----------------------------- */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.04);
    border-bottom: 1px solid var(--border-color);
    padding: 15px 40px;
}

.logo a {
    font-size: 26px;
    font-weight: 900;
    letter-spacing: -0.5px;
    transition: var(--transition);
}

.logo a:hover {
    opacity: 0.8;
}

/* Hero Section */
.hero-section {
    position: relative;
    height: 400px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.hero-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to bottom, rgba(0,0,0,0.4), rgba(0,0,0,0.7));
}

.hero-content {
    position: relative;
    z-index: 2;
    color: #fff;
    max-width: 800px;
    padding: 0 20px;
}

.hero-content h1 {
    font-size: 42px;
    font-weight: 900;
    margin-bottom: 15px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.hero-content p {
    font-size: 18px;
    margin-bottom: 30px;
    font-weight: 500;
    text-shadow: 0 1px 5px rgba(0,0,0,0.5);
}

.search-bar {
    display: flex;
    background: #fff;
    border-radius: 50px;
    overflow: hidden;
    max-width: 600px;
    margin: 0 auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.search-bar input {
    flex: 1;
    border: none;
    padding: 18px 25px;
    font-size: 16px;
    outline: none;
    font-family: inherit;
}

.search-bar button {
    background: var(--primary-color);
    color: #fff;
    border: none;
    padding: 0 30px;
    font-size: 18px;
    cursor: pointer;
    transition: var(--transition);
}

.search-bar button:hover {
    background: #a90a20;
}

/* Category Nav */
.category-nav {
    background: #fff;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 4px 15px rgba(0,0,0,0.02);
    position: sticky;
    top: 72px; /* Below header */
    z-index: 99;
}

.container-nav {
    margin: 0 auto;
    padding: 0 20px;
    max-width: 1200px;
}

.category-list {
    display: flex;
    list-style: none;
    gap: 30px;
    overflow-x: auto;
    padding: 15px 0;
    scrollbar-width: none;
}
.category-list::-webkit-scrollbar { display: none; }

.category-list li {
    font-size: 15px;
    font-weight: 700;
    color: #64748b;
    cursor: pointer;
    white-space: nowrap;
    padding: 8px 18px;
    border-radius: 20px;
    transition: var(--transition);
}

.category-list li:hover {
    color: var(--primary-color);
    background: #ffebee;
}

.category-list li.active {
    background: var(--primary-color);
    color: #fff;
}

/* Enhanced Product Cards */
.product-grid {
    gap: 40px 30px;
    padding-bottom: 60px;
}

.product-card {
    border-radius: 16px;
    border: 1px solid rgba(0,0,0,0.04);
    box-shadow: 0 10px 30px rgba(0,0,0,0.04);
    background: #fff;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.08);
}

.product-img {
    height: 240px;
    background: #fff;
    padding: 0;
    border-bottom: 1px solid #f1f5f9;
    border-radius: 16px 16px 0 0;
    overflow: hidden;
}

.product-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.product-card:hover .product-img img {
    transform: scale(1.08);
}

.product-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: var(--primary-color);
    color: #fff;
    font-size: 12px;
    font-weight: 900;
    padding: 4px 12px;
    border-radius: 20px;
    z-index: 2;
    box-shadow: 0 4px 10px rgba(209, 17, 44, 0.3);
}

.product-info {
    padding: 25px 20px;
}

.product-title {
    font-size: 16px;
    height: 48px;
    overflow: hidden;
    line-height: 1.5;
    margin-bottom: 15px;
    color: #1e293b;
    font-weight: 700;
}

.product-price {
    font-size: 22px;
    letter-spacing: -0.5px;
    color: #0f172a;
}

.btn-add {
    background: #fff;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    border-radius: 50px;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
}

.btn-add:hover {
    background: var(--primary-color);
    color: #fff;
}

/* Footer */
.footer {
    background: #1e293b;
    color: #cbd5e1;
    padding: 60px 0 30px;
    margin-top: 40px;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 40px;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-logo {
    font-size: 24px;
    font-weight: 900;
    color: #fff;
}

.footer-links {
    display: flex;
    list-style: none;
    gap: 30px;
    flex-wrap: wrap;
}

.footer-links a {
    color: #cbd5e1;
    text-decoration: none;
    font-size: 14px;
    transition: var(--transition);
}

.footer-links a:hover {
    color: #fff;
}

.footer-copy {
    text-align: center;
    font-size: 13px;
    color: #94a3b8;
}

/* Cart img fix */
.cart-item-img {
    width: 70px;
    height: 70px;
    border-radius: 10px;
    overflow: hidden;
    background: #f1f5f9;
}
.cart-item-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* -----------------------------
   Checkout Modal
----------------------------- */
.checkout-modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(5px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}
.checkout-modal-overlay.show { opacity: 1; visibility: visible; }
.checkout-modal-content {
    background: #fff;
    width: 90%; max-width: 500px;
    border-radius: 16px; padding: 40px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.2);
    transform: translateY(20px);
    transition: var(--transition);
}
.checkout-modal-overlay.show .checkout-modal-content { transform: translateY(0); }
.checkout-info {
    background: var(--bg-color);
    padding: 20px; border-radius: 12px; margin-bottom: 25px;
    font-size: 16px; border: 1px solid var(--border-color);
}
.checkout-info p { margin-bottom: 10px; }
.checkout-info p:last-child { margin-bottom: 0; }
.checkout-info span { font-weight: 900; color: var(--text-color); font-size: 18px; }
.checkout-notice {
    font-size: 14px; color: #64748b; line-height: 1.8;
    text-align: center; margin-bottom: 30px;
    background: #f8fafc; padding: 15px; border-radius: 8px;
}
.checkout-actions { display: flex; gap: 15px; }
.btn-cancel {
    flex: 1; padding: 14px; background: #fff; color: #64748b;
    border: 1px solid #cbd5e1; border-radius: 6px;
    font-size: 16px; font-weight: bold; cursor: pointer;
    transition: var(--transition);
}
.btn-cancel:hover { background: #f1f5f9; color: #0f172a; }
.checkout-actions .btn-submit { flex: 2; margin-top: 0; }
