@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@300;400;500;700&display=swap');

/* CSS Variables for consistent theming */
:root {
    --primary-color: #1a4b3a;
    --primary-light: #2d7a5a;
    --secondary-color: #ff6b6b;
    --accent-color: #ffd93d;
    --text-dark: #2c2c2c;
    --text-light: #666666;
    --text-muted: #999999;
    --background-light: #fafbfc;
    --background-white: #ffffff;
    --shadow-light: rgba(0, 0, 0, 0.08);
    --shadow-medium: rgba(0, 0, 0, 0.12);
    --shadow-strong: rgba(0, 0, 0, 0.2);
    --border-radius: 16px;
    --border-radius-small: 8px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.7;
    color: var(--text-dark);
    background: linear-gradient(135deg, #f8fffe 0%, #f0f8f5 100%);
    min-height: 100vh;
}

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

/* Header */
header {
    background: rgba(26, 75, 58, 0.95);
    backdrop-filter: blur(20px);
    color: white;
    padding: 1.2rem 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 4px 32px var(--shadow-light);
}

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

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: -0.5px;
}

.logo-emoji {
    font-size: 2rem;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.cart-icon {
    position: relative;
    cursor: pointer;
    font-size: 1.6rem;
    padding: 0.75rem;
    border-radius: var(--border-radius-small);
    transition: var(--transition);
    background: rgba(255, 255, 255, 0.1);
}

.cart-icon:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.cart-count {
    position: absolute;
    top: -4px;
    right: -4px;
    background: linear-gradient(135deg, var(--secondary-color), #ff5252);
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
}

/* Hero Section with Background Image Area */
.hero-section {
    margin-top: 80px; /* Account for fixed header */
    position: relative;
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(26, 75, 58, 0.8) 0%, rgba(45, 122, 90, 0.6) 100%);
    overflow: hidden;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('bg.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    z-index: -1;
}

.hero-background::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(26, 75, 58, 0.7) 0%, rgba(45, 122, 90, 0.5) 100%);
}

.hero-content {
    text-align: center;
    color: white;
    z-index: 2;
    max-width: 800px;
    padding: 3rem 2rem;
}

.hero-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    margin-bottom: 1.5rem;
    line-height: 1.2;
    text-shadow: 0 4px 16px rgba(0,0,0,0.3);
    letter-spacing: -1px;
}

.hero-subtitle {
    font-size: clamp(1.1rem, 2.5vw, 1.4rem);
    font-weight: 300;
    line-height: 1.6;
    margin-bottom: 2rem;
    opacity: 0.95;
    text-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.hero-cta {
    display: inline-block;
    background: linear-gradient(135deg, var(--accent-color), #ffed4e);
    color: var(--text-dark);
    padding: 1rem 2.5rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    box-shadow: 0 8px 32px rgba(255, 217, 61, 0.3);
    transition: var(--transition);
    border: none;
    cursor: pointer;
}

.hero-cta:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 48px rgba(255, 217, 61, 0.4);
}

/* Navigation */
nav {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    padding: 1.5rem 0;
    box-shadow: 0 2px 24px var(--shadow-light);
    position: sticky;
    top: 80px;
    z-index: 100;
}

.nav-content {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.category-btn {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.95rem;
    font-weight: 500;
    min-width: 100px;
}

.category-btn:hover,
.category-btn.active {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(26, 75, 58, 0.2);
}

/* Main Content */
main {
    padding: 4rem 0;
}

/* Product Grid */
.products-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2.5rem;
    margin-top: 3rem;
}

.product-card {
    background: var(--background-white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 8px 32px var(--shadow-light);
    transition: var(--transition);
    border: 1px solid rgba(0,0,0,0.04);
    position: relative;
}

.product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
    opacity: 0;
    transition: var(--transition);
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 64px var(--shadow-medium);
}

.product-card:hover::before {
    opacity: 1;
}

.product-image {
    width: 100%;
    height: 280px;
    background: linear-gradient(135deg, #f0f8f5, #e8f5e8);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    color: var(--primary-light);
    position: relative;
    overflow: hidden;
}

.product-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.1) 50%, transparent 70%);
    transform: translateX(-100%);
    transition: transform 0.8s ease;
}

.product-card:hover .product-image::after {
    transform: translateX(100%);
}

.product-info {
    padding: 2rem;
}

.product-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-dark);
    line-height: 1.3;
}

.product-category {
    background: linear-gradient(135deg, #f0f8f5, #e8f5e8);
    color: var(--primary-color);
    padding: 0.4rem 1rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 500;
    display: inline-block;
    margin-bottom: 1rem;
    border: 1px solid rgba(26, 75, 58, 0.1);
}

.product-description {
    color: var(--text-light);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    line-height: 1.6;
}

.product-price {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--secondary-color);
    margin-bottom: 1.5rem;
}

.add-to-cart {
    width: 100%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    border: none;
    padding: 1rem;
    border-radius: var(--border-radius-small);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.add-to-cart::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.add-to-cart:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(26, 75, 58, 0.3);
}

.add-to-cart:hover::before {
    left: 100%;
}

/* Cart Modal */
.cart-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 2000;
    animation: fadeIn 0.3s ease;
}

.cart-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--background-white);
    padding: 2.5rem;
    border-radius: var(--border-radius);
    max-width: 600px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 24px 96px var(--shadow-strong);
    animation: slideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { 
        opacity: 0;
        transform: translate(-50%, -60%);
    }
    to { 
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 1.5rem;
}

.cart-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-dark);
}

.close-cart {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0.5rem;
    border-radius: var(--border-radius-small);
    transition: var(--transition);
}

.close-cart:hover {
    color: var(--text-dark);
    background: #f0f0f0;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 0;
    border-bottom: 1px solid #f0f0f0;
}

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

.cart-item-name {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.cart-item-price {
    color: var(--secondary-color);
    font-weight: 600;
    font-size: 1.1rem;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0 1.5rem;
}

.quantity-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    transition: var(--transition);
}

.quantity-btn:hover {
    background: var(--primary-light);
    transform: scale(1.1);
}

.quantity-display {
    min-width: 40px;
    text-align: center;
    font-weight: 600;
    font-size: 1.1rem;
}

.cart-total {
    text-align: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid #f0f0f0;
}

.total-price {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.checkout-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--secondary-color), #ff5252);
    color: white;
    border: none;
    padding: 1.2rem;
    border-radius: var(--border-radius-small);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.checkout-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(255, 107, 107, 0.3);
}

.checkout-btn:active {
    transform: translateY(0);
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }

    header {
        padding: 1rem 0;
    }

    .header-content {
        flex-direction: column;
        gap: 1rem;
    }

    .hero-section {
        min-height: 60vh;
        margin-top: 120px; /* Adjust for larger mobile header */
    }

    .hero-content {
        padding: 2rem 1rem;
    }

    .nav-content {
        gap: 0.75rem;
        padding: 0 1rem;
    }

    .category-btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
        min-width: 80px;
    }

    .products-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
        margin-top: 2rem;
    }

    .product-card {
        margin: 0 auto;
        max-width: 400px;
    }

    .cart-content {
        padding: 2rem;
        margin: 1rem;
        width: calc(100% - 2rem);
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }

    .products-section {
        padding: 0 16px;
    }

    .product-info {
        padding: 1.5rem;
    }
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.fade-in {
    animation: fadeIn 0.5s ease;
}

.bounce {
    animation: bounce 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes bounce {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Additional Styles for Enhanced UI */

/* Section Headers */
.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1rem;
    letter-spacing: -1px;
}

.section-subtitle {
    font-size: 1.2rem;
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto;
}

/* Enhanced Product Cards */
.product-rating {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.stars {
    color: var(--accent-color);
    font-size: 1rem;
}

.rating-value {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
}

.product-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.tag {
    background: rgba(26, 75, 58, 0.1);
    color: var(--primary-color);
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid rgba(26, 75, 58, 0.2);
}

/* Enhanced Cart Modal */
.cart-body {
    max-height: 60vh;
    overflow-y: auto;
    margin: 1rem 0;
}

.cart-footer {
    border-top: 2px solid #f0f0f0;
    padding-top: 1.5rem;
}

.cart-item {
    display: grid;
    grid-template-columns: 60px 1fr auto auto;
    gap: 1rem;
    align-items: center;
    padding: 1.5rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.cart-item-image {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #f0f8f5, #e8f5e8);
    border-radius: var(--border-radius-small);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.cart-item-category {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.remove-item-btn {
    background: var(--secondary-color);
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    transition: var(--transition);
}

.remove-item-btn:hover {
    background: #ff5252;
    transform: scale(1.1);
}

.empty-cart {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-light);
}

.empty-cart-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-cart-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

/* Footer */
.footer {
    background: var(--primary-color);
    color: white;
    padding: 3rem 0 1rem;
    margin-top: 4rem;
}

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

.footer-section h3,
.footer-section h4 {
    margin-bottom: 1rem;
    font-weight: 600;
}

.footer-section h3 {
    font-size: 1.3rem;
}

.footer-section h4 {
    font-size: 1.1rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section ul li a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: var(--transition);
}

.footer-section ul li a:hover {
    color: white;
}

.payment-methods {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.payment-methods span {
    font-size: 0.9rem;
    opacity: 0.8;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.footer-bottom p {
    margin-bottom: 0.5rem;
    opacity: 0.7;
}

.footer-note {
    background: rgba(255, 217, 61, 0.1);
    border: 1px solid rgba(255, 217, 61, 0.3);
    border-radius: var(--border-radius-small);
    padding: 1rem;
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--accent-color);
}

/* Disabled button state */
.add-to-cart.disabled {
    background: #ccc !important;
    cursor: not-allowed;
    transform: none !important;
}

.add-to-cart.disabled:hover {
    box-shadow: none !important;
}

/* Loading state */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Mobile-specific enhancements */
@media (max-width: 768px) {
    .section-title {
        font-size: 2rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .cart-item {
        grid-template-columns: 50px 1fr auto;
        gap: 0.75rem;
    }

    .remove-item-btn {
        grid-column: 3;
        grid-row: 1;
        align-self: start;
    }

    .quantity-controls {
        grid-column: 1 / -1;
        justify-self: center;
        margin-top: 1rem;
    }
}