:root {
    --primary-color: #8D7B68; /* Elegant Taupe from Logo */
    --primary-dark: #705B48;
    --primary-light: #F4EBE1;
    --text-main: #3C352E;
    --text-muted: #80766B;
    --bg-light: #FAF9F7;
    --white: #ffffff;
    --border-color: #E8E1DA;
    --card-shadow: 0 10px 25px -5px rgba(141, 123, 104, 0.05), 0 8px 10px -6px rgba(141, 123, 104, 0.02);
    --hover-shadow: 0 20px 25px -5px rgba(141, 123, 104, 0.1), 0 10px 10px -5px rgba(141, 123, 104, 0.05);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
}

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

body {
    font-family: 'Noto Sans JP', 'Inter', sans-serif;
    background-color: var(--bg-light);
    color: var(--text-main);
    line-height: 1.6;
    padding-bottom: 200px; /* Space for sticky bar */
}

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

/* Header */
.main-header {
    background: linear-gradient(135deg, #ffffff 0%, #fff0f1 100%);
    position: relative;
    padding-top: 60px;
    padding-bottom: 150px;
    text-align: center;
    border-bottom: 1px solid #fce7e8;
}

.header-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

.sub-text {
    display: block;
    font-size: 1rem;
    color: var(--primary-color);
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: 0.1em;
}

.logo-title {
    font-size: 2.5rem;
    font-weight: 900;
    color: #1e293b;
    margin-bottom: 16px;
    letter-spacing: -0.05em;
}

.header-desc {
    font-size: 1.1rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Header Wave */
.header-wave {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    overflow: hidden;
    line-height: 0;
    z-index: 1;
}

.header-wave svg {
    position: relative;
    display: block;
    width: calc(100% + 1.3px);
    height: 60px;
}

.header-wave .shape-fill {
    fill: var(--bg-light);
}

/* Main Section */
.simulator-wrapper {
    margin-top: -60px;
    position: relative;
    z-index: 10;
}

.section-heading {
    text-align: center;
    margin-bottom: 40px;
}

.section-heading h2 {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 12px;
    color: #1e293b;
}

.section-heading p {
    color: var(--text-muted);
}

/* Product Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
}

/* Product Card */
.product-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--card-shadow);
    overflow: hidden;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(0,0,0,0.03);
    position: relative;
}

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

.card-image-wrap {
    height: 140px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.card-image-wrap::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40%;
    background: linear-gradient(to top, rgba(255,255,255,1), rgba(255,255,255,0));
}

.product-badge {
    position: absolute;
    top: 16px;
    left: 16px;
    background: var(--white);
    color: var(--primary-color);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
    z-index: 2;
}

.product-real-image {
    max-width: 80%;
    max-height: 120px;
    object-fit: contain;
    z-index: 1;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.product-card:hover .product-real-image {
    transform: scale(1.15) translateY(-5px);
}

.card-content {
    padding: 24px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-type {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--bg-light);
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    margin-bottom: 8px;
    font-weight: 600;
    align-self: flex-start;
}

.product-name {
    font-size: 1.25rem;
    font-weight: 800;
    margin-bottom: 8px;
    color: #0f172a;
    line-height: 1.4;
}

.product-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 16px;
    flex-grow: 1;
}

.product-price {
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--primary-color);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
}

.product-price small {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-left: 4px;
}

/* Configurator inside card */
.schedule-config {
    background: var(--bg-light);
    border-radius: var(--radius-md);
    padding: 16px;
    border: 1px solid var(--border-color);
}

.config-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    color: #475569;
    margin-bottom: 12px;
}

.day-chips {
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
    justify-content: space-between;
}

.day-chip {
    flex-grow: 1;
    text-align: center;
    padding: 8px 0;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
}

.day-chip:hover {
    border-color: #cbd5e1;
    background: #f1f5f9;
}

.day-chip.selected {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
    box-shadow: 0 4px 10px rgba(141, 123, 104, 0.2);
}

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

.qty-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

.qty-spinner {
    display: flex;
    align-items: center;
    background: var(--white);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.qty-btn {
    border: none;
    background: none;
    padding: 8px 12px;
    cursor: pointer;
    color: var(--text-main);
    transition: var(--transition);
    font-weight: bold;
}

.qty-btn:hover {
    background: var(--bg-light);
}

.qty-btn:disabled {
    color: #cbd5e1;
    cursor: not-allowed;
}

.qty-value {
    width: 30px;
    text-align: center;
    font-weight: 700;
    font-size: 1rem;
}

.item-subtotal {
    margin-top: 12px;
    text-align: right;
    font-size: 0.9rem;
    font-weight: 700;
    color: #0f172a;
    display: none; /* Shown via JS when > 0 */
}

/* Sticky Bottom Bar */
.estimation-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid rgba(0,0,0,0.08);
    padding: 20px 0;
    z-index: 1000;
    box-shadow: 0 -10px 30px rgba(0,0,0,0.05);
    transform: translateY(100%); /* hidden default */
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    animation-delay: 0.5s;
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.estimation-bar.collapsed {
    transform: translateY(100%) !important;
    animation: none;
}

.estimation-toggle {
    position: absolute;
    top: -24px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 24px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(0,0,0,0.08);
    border-bottom: none;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    color: var(--text-light);
    box-shadow: 0 -4px 10px rgba(0,0,0,0.02);
}

@keyframes slideUp {
    to { transform: translateY(0); }
}

/* Scroll To Top Button */
.scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: #8D7B68;
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.25rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    cursor: pointer;
    z-index: 1005;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
}

.scroll-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-to-top:hover {
    background: #a3907c;
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.2);
    color: white;
}

/* Prevent overlap with the estimation bar on desktop/tablet */
body:has(.estimation-bar:not(.collapsed)) .scroll-to-top {
    bottom: 130px;
}

.estimation-bar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
}

.est-summary {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

.est-item {
    display: flex;
    flex-direction: column;
}

.est-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.est-value {
    font-size: 1.5rem;
    font-weight: 900;
    color: #1e293b;
    display: flex;
    align-items: baseline;
}

.est-value small {
    font-size: 0.9rem;
    font-weight: 600;
    margin-left: 2px;
    margin-right: 2px;
}

.est-value.highlight {
    color: var(--primary-color);
}

.est-item.month-est {
    border-left: 1px solid var(--border-color);
    padding-left: 30px;
}

.tax-info {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-left: 6px;
}

.est-action {
    flex-shrink: 0;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--white);
    border: none;
    padding: 16px 32px;
    font-size: 1.1rem;
    font-weight: 800;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(141, 123, 104, 0.3);
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(141, 123, 104, 0.4);
}

.btn-primary:disabled {
    background: #cbd5e1;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

/* Responsive */
@media (max-width: 768px) {
    .estimation-bar-inner {
        flex-direction: column;
        align-items: stretch;
    }
    
    .est-summary {
        flex-direction: column;
        gap: 15px;
    }

    .est-item.month-est {
        border-left: none;
        padding-left: 0;
        border-top: 1px solid var(--border-color);
        padding-top: 15px;
    }

    .btn-primary {
        width: 100%;
        justify-content: center;
    }

    body {
        padding-bottom: 280px;
        font-size: 0.95rem;
    }
    
    .product-grid {
        grid-template-columns: 1fr;
    }
    
    .logo-title {
        font-size: 1.8rem !important;
        letter-spacing: 0;
    }
    
    .header-desc {
        font-size: 0.95rem !important;
    }
    
    .hero-title {
        font-size: 1.8rem !important;
        line-height: 1.35 !important;
    }
    
    .hero-desc {
        font-size: 0.95rem !important;
    }
    
    .section-heading h2 {
        font-size: 1.5rem !important;
        line-height: 1.4 !important;
    }
    
    .section-heading p {
        font-size: 0.9rem !important;
    }
    
    .product-title, .product-name {
        font-size: 1.15rem !important;
    }
    
    .pc-only {
        display: none !important;
    }
    
    .sp-only {
        display: block !important;
    }
    
    span.sp-only {
        display: inline !important;
    }
    
    .scroll-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }
    
    /* Prevent overlap with the taller stacked estimation bar on mobile */
    body:has(.estimation-bar:not(.collapsed)) .scroll-to-top {
        bottom: 250px;
    }
}

@media (min-width: 769px) {
    .sp-only {
        display: none !important;
    }
}
