/*
 * Nakaoka EC — Redesigned to Match EXCIA System
 * Theme: Light Blue Gradient + Purple Accent
 */

:root {
    --bg-gradient-start: #dce6f5;
    --bg-gradient-end: #e8eef8;
    --card-bg: #ffffff;
    --primary: #6c5ce7;
    --primary-hover: #5a4bd6;
    --primary-light: #a29bfe;
    --accent-blue: #3b82f6;
    --accent-blue-hover: #2563eb;
    --text-dark: #2d3748;
    --text-mid: #4a5568;
    --text-light: #718096;
    --border: #e2e8f0;
    --border-light: #edf2f7;
    --success: #48bb78;
    --danger: #fc8181;
    --warning: #f6ad55;
    --font-sans: 'Noto Sans JP', sans-serif;
    --font-display: 'Outfit', sans-serif;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.08);
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: var(--font-sans);
    background: linear-gradient(135deg, var(--bg-gradient-start), var(--bg-gradient-end));
    min-height: 100vh;
    color: var(--text-dark);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ─── HEADER ─── */
.ec-header {
    position: sticky;
    top: 0;
    z-index: 200;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-light);
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.9rem 1.5rem;
}

.ec-logo {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ec-logo::before {
    content: '';
    font-size: 1.4rem;
}

.ec-logo span {
    color: var(--accent-blue);
}

.ec-nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-link {
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color var(--transition);
}

.nav-link:hover {
    color: var(--primary);
}

.cart-btn {
    position: relative;
    background: none;
    border: none;
    color: var(--text-mid);
    cursor: pointer;
    padding: 0.5rem;
    transition: color var(--transition);
}

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

.cart-count {
    position: absolute;
    top: -2px;
    right: -6px;
    background: var(--primary);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
}

/* ─── HERO ─── */
.ec-hero {
    background: var(--card-bg);
    border-radius: 0 0 32px 32px;
    padding: 3.5rem 1.5rem 3rem;
    text-align: center;
    box-shadow: var(--shadow);
    margin-bottom: 0.5rem;
}

.hero-tag {
    font-family: var(--font-display);
    color: var(--primary);
    font-size: 0.75rem;
    letter-spacing: 0.3em;
    font-weight: 500;
    margin-bottom: 0.75rem;
}

.ec-hero h1 {
    color: var(--text-dark);
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 0.5rem;
}

.hero-sub {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* ─── FILTER BAR ─── */
.filter-bar {
    position: sticky;
    top: 56px;
    z-index: 100;
    padding: 0.75rem 0;
}

.filter-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.filter-inner::-webkit-scrollbar {
    display: none;
}

.filter-chip {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 0.45rem 1.1rem;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--transition);
    color: var(--text-mid);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.filter-chip:hover {
    background: var(--primary-light);
    color: #fff;
    border-color: var(--primary-light);
}

.filter-chip.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(108, 92, 231, 0.3);
}

/* ─── PRODUCT GRID ─── */
.product-grid-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 1.5rem 3rem;
}

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

.product-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform var(--transition), box-shadow var(--transition);
    border: 1px solid var(--border-light);
}

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

.product-img {
    aspect-ratio: 1;
    background-color: #f7fafc;
    background-size: cover;
    background-position: center;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.no-img {
    color: var(--text-light);
    font-size: 0.85rem;
}

.out-of-stock-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    font-size: 0.7rem;
    padding: 0.3rem 0.7rem;
    border-radius: 6px;
}

.product-info {
    padding: 1rem 1.1rem 1.1rem;
}

.product-category {
    font-size: 0.7rem;
    color: var(--primary);
    font-weight: 600;
    letter-spacing: 0.03em;
}

.product-name {
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0.25rem 0 0.7rem;
    line-height: 1.4;
    color: var(--text-dark);
}

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

.product-price {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-dark);
}

.add-to-cart-btn {
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    padding: 0.5rem 1rem;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}

.add-to-cart-btn:hover {
    background: var(--primary-hover);
    transform: scale(1.03);
}

.add-to-cart-btn.added {
    background: var(--success);
}

.add-to-cart-btn:disabled {
    background: var(--text-light);
    cursor: not-allowed;
    opacity: 0.6;
}

/* ─── CART DRAWER ─── */
.cart-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 300;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition);
}

.cart-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.cart-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 380px;
    max-width: 90vw;
    height: 100%;
    background: var(--card-bg);
    z-index: 400;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform var(--transition);
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.08);
}

.cart-drawer.open {
    transform: translateX(0);
}

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

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

.cart-close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.5rem;
}

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

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-light);
}

.cart-item-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-dark);
}

.cart-item-price {
    font-size: 0.85rem;
    color: var(--text-light);
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.qty-btn {
    width: 30px;
    height: 30px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--card-bg);
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition);
}

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

.qty-display {
    font-size: 0.9rem;
    min-width: 20px;
    text-align: center;
    font-weight: 600;
}

.remove-btn {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    font-size: 0.9rem;
    margin-left: 0.5rem;
}

.remove-btn:hover {
    color: var(--danger);
}

.cart-footer {
    border-top: 1px solid var(--border);
    padding: 1.5rem;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.checkout-btn {
    display: block;
    text-align: center;
    background: var(--primary);
    color: #fff;
    text-decoration: none;
    padding: 0.9rem;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.95rem;
    transition: all var(--transition);
    box-shadow: 0 3px 12px rgba(108, 92, 231, 0.25);
}

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

/* ─── LOADING ─── */
.loading-state {
    text-align: center;
    padding: 4rem;
    color: var(--text-light);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    margin: 0 auto 1rem;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.empty-state {
    text-align: center;
    padding: 4rem;
    color: var(--text-light);
}

/* ─── CHECKOUT PAGE ─── */
.checkout-container {
    max-width: 700px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
}

.checkout-container h1 {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    color: var(--text-dark);
}

.checkout-cart,
.checkout-form {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
}

.checkout-cart h2,
.checkout-form h2 {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.checkout-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.9rem;
}

.checkout-total {
    display: flex;
    justify-content: space-between;
    font-weight: 700;
    font-size: 1.1rem;
    padding-top: 1rem;
    margin-top: 0.5rem;
    color: var(--text-dark);
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
    color: var(--text-mid);
}

.required {
    color: var(--danger);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-family: var(--font-sans);
    transition: border-color var(--transition), box-shadow var(--transition);
    background: #fff;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.submit-btn {
    width: 100%;
    padding: 1rem;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition);
    margin-top: 0.5rem;
    box-shadow: 0 3px 12px rgba(108, 92, 231, 0.25);
}

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

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ─── THANKS PAGE ─── */
.thanks-container {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.thanks-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 3rem 2rem;
    text-align: center;
    max-width: 500px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-light);
}

.thanks-icon {
    width: 64px;
    height: 64px;
    background: var(--success);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    margin: 0 auto 1.5rem;
}

.thanks-card h1 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.thanks-message {
    color: var(--text-light);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.order-id {
    background: #f7fafc;
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    margin-bottom: 1.5rem;
    color: var(--text-mid);
    border: 1px solid var(--border-light);
}

.back-to-shop-btn {
    display: inline-block;
    background: var(--primary);
    color: #fff;
    text-decoration: none;
    padding: 0.75rem 2rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    transition: all var(--transition);
    box-shadow: 0 3px 12px rgba(108, 92, 231, 0.25);
}

.back-to-shop-btn:hover {
    background: var(--primary-hover);
}

/* ─── FOOTER ─── */
.ec-footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-light);
    font-size: 0.8rem;
}

/* ─── RESPONSIVE ─── */
@media (max-width: 768px) {
    .ec-hero {
        padding: 2.5rem 1rem 2rem;
        border-radius: 0 0 24px 24px;
    }

    .ec-hero h1 {
        font-size: 1.4rem;
    }

    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .product-info {
        padding: 0.75rem;
    }

    .product-name {
        font-size: 0.82rem;
    }

    .product-price {
        font-size: 0.9rem;
    }

    .add-to-cart-btn {
        padding: 0.4rem 0.7rem;
        font-size: 0.7rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .filter-bar {
        top: 52px;
    }
}

/* ─── AUTH LINK (Header) ─── */
.auth-link {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 500;
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

.auth-link:hover {
    background: rgba(108, 92, 231, 0.08);
    color: var(--primary);
}

.auth-link svg {
    flex-shrink: 0;
}

.logout-link {
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--font-sans);
    font-size: 0.85rem;
}

/* ─── AUTH PAGE (Login/Register) ─── */
.auth-container {
    max-width: 520px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
}

.auth-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-light);
    overflow: hidden;
}

.auth-tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
}

.auth-tab {
    flex: 1;
    padding: 1rem;
    background: none;
    border: none;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-light);
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
    font-family: var(--font-sans);
}

.auth-tab:hover {
    color: var(--primary);
    background: rgba(108, 92, 231, 0.04);
}

.auth-tab.active {
    color: var(--primary);
}

.auth-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary);
    border-radius: 3px 3px 0 0;
}

.auth-panel {
    display: none;
    padding: 2rem 1.5rem;
}

.auth-panel.active {
    display: block;
}

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

.auth-error {
    background: #fff5f5;
    border: 1px solid #fed7d7;
    color: #c53030;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.auth-success {
    background: #f0fff4;
    border: 1px solid #c6f6d5;
    color: #276749;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.reset-link {
    display: block;
    text-align: center;
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 0.85rem;
    cursor: pointer;
    padding: 1rem;
    transition: color var(--transition);
    font-family: var(--font-sans);
}

.reset-link:hover {
    color: var(--primary);
}

/* ─── MYPAGE ─── */
.mypage-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
}

.mypage-container h1 {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    color: var(--text-dark);
}

.mypage-section {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
}

.mypage-section h2 {
    font-size: 1rem;
    margin-bottom: 1.25rem;
    color: var(--text-dark);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.section-header h2 {
    margin-bottom: 0;
}

.edit-btn {
    background: none;
    border: 1px solid var(--primary);
    color: var(--primary);
    padding: 0.4rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-family: var(--font-sans);
}

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

.profile-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.profile-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.profile-label {
    font-size: 0.75rem;
    color: var(--text-light);
    font-weight: 600;
    letter-spacing: 0.02em;
}

.profile-value {
    font-size: 0.95rem;
    color: var(--text-dark);
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.cancel-btn {
    flex: 1;
    padding: 0.8rem;
    background: #f7fafc;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    color: var(--text-mid);
    font-family: var(--font-sans);
}

.cancel-btn:hover {
    background: #edf2f7;
}

.submit-btn-sm {
    flex: 1;
}

/* Order history */
.empty-orders {
    text-align: center;
    color: var(--text-light);
    padding: 2rem 0;
}

.order-card {
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 1rem;
    margin-bottom: 0.75rem;
    transition: box-shadow var(--transition);
}

.order-card:hover {
    box-shadow: var(--shadow);
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.order-date {
    font-size: 0.85rem;
    color: var(--text-mid);
    font-weight: 500;
}

.order-status {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    margin-left: 0.5rem;
}

.status-pending {
    background: #fefcbf;
    color: #b7791f;
}

.status-done {
    background: #c6f6d5;
    color: #276749;
}

.order-total {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text-dark);
}

.order-items {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.5rem;
}

.order-item-name {
    font-size: 0.8rem;
    background: #f7fafc;
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    color: var(--text-mid);
}

.order-id-small {
    font-size: 0.75rem;
    color: var(--text-light);
}

@media (max-width: 768px) {
    .profile-grid {
        grid-template-columns: 1fr;
    }

    .auth-container {
        padding: 1rem;
    }

    .auth-panel {
        padding: 1.5rem 1rem;
    }
}

/* ─── PRICE GATE (Login to see price) ─── */
.price-gate {
    justify-content: center;
}

.login-to-see-price {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    color: #fff;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    font-weight: 600;
    transition: all var(--transition);
    box-shadow: 0 2px 8px rgba(108, 92, 231, 0.25);
    width: 100%;
    justify-content: center;
}

.login-to-see-price:hover {
    transform: scale(1.03);
    box-shadow: 0 4px 16px rgba(108, 92, 231, 0.35);
}

/* ─── PASSWORD TOGGLE ─── */
.password-field {
    position: relative;
}

.password-field input {
    width: 100%;
    padding-right: 3rem;
}

.password-toggle {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-light);
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color var(--transition);
}

.password-toggle:hover {
    color: var(--primary);
}

/* ─── POSTAL CODE AUTO-FILL ─── */
.zip-loading {
    background-image: linear-gradient(90deg, transparent, rgba(108, 92, 231, 0.1), transparent);
    background-size: 200% 100%;
    animation: shimmer 1s infinite;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.zip-found {
    animation: flashGreen 0.5s ease;
}

@keyframes flashGreen {
    0% {
        background-color: #c6f6d5;
    }

    100% {
        background-color: #fff;
    }
}

/* ─── ADMIN PANEL ─── */
.admin-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
}

.admin-container h1 {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    color: var(--text-dark);
}

.product-count-badge {
    display: inline-block;
    background: var(--primary);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.15rem 0.6rem;
    border-radius: 12px;
    margin-left: 0.3rem;
    vertical-align: middle;
}

.admin-product-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
    transition: all var(--transition);
}

.admin-product-card:hover {
    box-shadow: var(--shadow);
}

.admin-product-card.dup-warning {
    border-color: var(--warning);
    background: #fffbeb;
}

.admin-product-img {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    background: #f7fafc;
    display: flex;
    align-items: center;
    justify-content: center;
}

.admin-product-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.no-img-sm {
    font-size: 1.2rem;
}

.admin-product-info {
    flex: 1;
    min-width: 0;
}

.admin-product-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dup-badge {
    display: inline-block;
    background: var(--warning);
    color: #fff;
    font-size: 0.6rem;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    margin-left: 0.3rem;
    font-weight: 700;
    vertical-align: middle;
}

.admin-product-meta {
    display: flex;
    gap: 0.6rem;
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: 0.2rem;
}

.admin-category-tag {
    background: rgba(108, 92, 231, 0.1);
    color: var(--primary);
    padding: 0.05rem 0.4rem;
    border-radius: 4px;
    font-weight: 600;
}

.admin-product-actions {
    flex-shrink: 0;
}

.delete-product-btn {
    background: none;
    border: 1px solid var(--danger);
    color: var(--danger);
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    font-family: var(--font-sans);
}

.delete-product-btn:hover {
    background: var(--danger);
    color: #fff;
}

/* ─── MOBILE-FIRST ENHANCEMENTS ─── */
@media (max-width: 768px) {

    /* ヘッダー: コンパクトに */
    .header-inner {
        padding: 0.5rem 0.75rem;
    }

    .ec-logo {
        font-size: 0.95rem;
    }

    .ec-logo span {
        display: none;
    }

    .ec-nav {
        gap: 0.5rem;
    }

    /* Corporateリンクはモバイルで非表示 */
    .ec-nav .nav-link:first-child {
        display: none;
    }

    /* ログインリンクをコンパクトに */
    .nav-link {
        font-size: 0.7rem;
        white-space: nowrap;
    }

    .auth-link {
        font-size: 0.7rem;
        padding: 0.35rem 0.5rem;
        white-space: nowrap;
    }

    .auth-link svg {
        width: 16px;
        height: 16px;
    }

    .cart-btn svg {
        width: 20px;
        height: 20px;
    }

    /* 商品カード: 2列 → タッチフレンドリー */
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
        padding: 0 0.5rem;
    }

    .product-info {
        padding: 0.5rem;
    }

    .product-name {
        font-size: 0.72rem;
        line-height: 1.3;
    }

    .product-category {
        font-size: 0.6rem;
    }

    .product-price {
        font-size: 0.85rem;
    }

    .add-to-cart-btn {
        padding: 0.4rem 0.5rem;
        font-size: 0.65rem;
        min-height: 32px;
    }

    /* 価格ゲートボタン: 1行で収まるように */
    .login-to-see-price {
        padding: 0.4rem 0.3rem;
        font-size: 0.62rem;
        min-height: 32px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* フォーム: タッチ操作しやすく */
    .form-group input,
    .form-group textarea {
        padding: 0.9rem 1rem;
        font-size: 16px;
        /* iOS zoom prevention */
    }

    .submit-btn {
        padding: 1rem;
        font-size: 1rem;
        min-height: 48px;
    }

    .cancel-btn {
        min-height: 48px;
    }

    /* カートドロワー */
    .cart-drawer {
        width: 100vw;
        max-width: 100vw;
    }

    .qty-btn {
        width: 36px;
        height: 36px;
    }

    /* マイページ */
    .mypage-container {
        padding: 1.5rem 1rem 3rem;
    }

    .mypage-container h1 {
        font-size: 1.3rem;
    }

    /* 管理パネル */
    .admin-container {
        padding: 1.5rem 1rem 3rem;
    }

    .admin-product-card {
        padding: 0.6rem;
        gap: 0.5rem;
    }

    .admin-product-img {
        width: 40px;
        height: 40px;
    }

    .admin-product-name {
        font-size: 0.78rem;
    }

    .admin-product-meta {
        flex-wrap: wrap;
        gap: 0.3rem;
    }

    /* フィルターバー */
    .filter-chip {
        padding: 0.5rem 1rem;
        font-size: 0.78rem;
        min-height: 36px;
    }

    /* ヒーロー */
    .ec-hero {
        padding: 2rem 1rem 1.5rem;
    }

    .ec-hero h1 {
        font-size: 1.3rem;
    }

    .hero-sub {
        font-size: 0.8rem;
    }
}

/* ═══════════════════════════════════════════════════════
   ADMIN DASHBOARD STYLES
   ═══════════════════════════════════════════════════════ */

.dashboard-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.dashboard-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-dark);
}

/* ─── Tab Navigation ─── */
.tab-nav {
    display: flex;
    gap: 0;
    border-bottom: 3px solid var(--border-light);
    margin-bottom: 2rem;
    overflow-x: auto;
}

.tab-btn {
    flex: 0 1 auto;
    padding: 1rem 1.5rem;
    background: none;
    border: none;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 3px solid transparent;
    margin-bottom: -3px;
    white-space: nowrap;
    font-family: var(--font-sans);
}

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

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-icon {
    margin-right: 0.5rem;
    font-size: 1.1rem;
}

/* ─── Tab Panels ─── */
.tab-panel {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-panel.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ─── Dashboard Stats ─── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-box {
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    border-radius: var(--radius-sm);
    padding: 1.5rem;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow);
    transition: all 0.2s ease;
}

.stat-box:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.25rem;
    font-family: var(--font-display);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-light);
}

/* ─── Section Styles ─── */
.section {
    background: #fff;
    border-radius: var(--radius-sm);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-light);
}

.section-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-dark);
}

.action-btn {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    font-family: var(--font-sans);
}

.action-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.action-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ─── Form Styles ─── */
.form-wrap {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.5rem;
    border: 2px dashed var(--border);
}

.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.4rem;
    font-size: 0.95rem;
}

.required {
    color: #e53e3e;
}

.form-input {
    width: 100%;
    padding: 0.7rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-family: var(--font-sans);
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

/* ─── Image Upload ─── */
.image-upload {
    border: 2px dashed var(--border);
    border-radius: var(--radius-sm);
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #f8f9fa;
}

.image-upload:hover {
    border-color: var(--primary);
    background: rgba(108, 92, 231, 0.05);
}

.image-upload.dragover {
    border-color: var(--primary);
    background: rgba(108, 92, 231, 0.1);
    transform: scale(1.02);
}

#image-preview {
    margin-top: 1rem;
    border-radius: var(--radius-sm);
    overflow: hidden;
}

#image-preview img {
    max-width: 200px;
    max-height: 200px;
    border-radius: var(--radius-sm);
}

/* ─── Product Table ─── */
.product-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.product-table thead {
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    border-bottom: 2px solid var(--border);
}

.product-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 700;
    color: var(--text-dark);
}

.product-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-light);
}

.product-table tbody tr:hover {
    background: #f8f9fa;
}

.product-img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: var(--radius-sm);
}

.product-actions {
    display: flex;
    gap: 0.5rem;
}

.edit-btn,
.delete-btn {
    padding: 0.4rem 0.8rem;
    border: 1px solid;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    background: none;
    font-family: var(--font-sans);
}

.edit-btn {
    background: #e6f3ff;
    color: #0066cc;
    border-color: #99ccff;
}

.edit-btn:hover {
    background: #cce5ff;
    transform: translateY(-1px);
}

.delete-btn {
    background: #ffe6e6;
    color: #cc0000;
    border-color: #ff9999;
}

.delete-btn:hover {
    background: #ffcccc;
    transform: translateY(-1px);
}

/* ─── Messages ─── */
.message {
    padding: 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    display: none;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.success {
    background: #e6ffed;
    color: #1a5c3e;
    border-left: 4px solid #2db87a;
}

.message.error {
    background: #ffe6e6;
    color: #5c1a1a;
    border-left: 4px solid #d92d2d;
}

.message.info {
    background: #e6f3ff;
    color: #1a3a5c;
    border-left: 4px solid #2d92d9;
}

/* ─── Empty State ─── */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-light);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* ─── Color Picker ─── */
.color-input {
    width: 60px;
    height: 60px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
    .dashboard-container {
        padding: 1rem;
    }

    .tab-btn {
        padding: 0.8rem 1rem;
        font-size: 0.85rem;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .stat-box {
        padding: 1rem;
    }

    .stat-number {
        font-size: 1.5rem;
    }

    .section {
        padding: 1rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .product-actions {
        flex-direction: column;
    }

    .edit-btn,
    .delete-btn {
        width: 100%;
    }
}
/* ================================================================
   BEAUTY GARAGE 風リニューアル CSS
   ================================================================ */

/* ─── Top Info Bar ─── */
.topbar {
  background: #1a1a2e;
  color: #ccc;
  font-size: 0.8rem;
  padding: 0;
}
.topbar-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 1rem;
  flex-wrap: wrap;
  gap: 4px;
}
.topbar-links,
.topbar-right {
  list-style: none;
  display: flex;
  gap: 1.2rem;
  margin: 0;
  padding: 0;
}
.topbar-links a,
.topbar-right a {
  color: #ccc;
  text-decoration: none;
  font-size: 0.78rem;
  transition: color 0.2s;
}
.topbar-links a:hover,
.topbar-right a:hover { color: #fff; }

/* ─── Header: 3-column layout ─── */
.ec-header {
  background: #fff;
  border-bottom: 1px solid #e0e0e0;
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
}
.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.7rem 1rem;
}
.ec-logo {
  font-family: 'Outfit', sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: #1a1a2e;
  text-decoration: none;
  letter-spacing: 0.05em;
  white-space: nowrap;
  flex-shrink: 0;
}
.ec-logo span { color: var(--primary, #6c5ce7); }

/* Search */
.header-search {
  flex: 1;
  display: flex;
  border: 2px solid #1a1a2e;
  border-radius: 4px;
  overflow: hidden;
  max-width: 500px;
}
.header-search-input {
  flex: 1;
  border: none;
  outline: none;
  padding: 0.5rem 0.8rem;
  font-size: 0.9rem;
  background: #fafafa;
}
.header-search-btn {
  background: #1a1a2e;
  color: #fff;
  border: none;
  padding: 0 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: background 0.2s;
}
.header-search-btn:hover { background: #333; }

/* Header Icons */
.header-icons {
  display: flex;
  gap: 0.2rem;
  flex-shrink: 0;
}
.icon-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #333;
  text-decoration: none;
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  font-size: 0.7rem;
  cursor: pointer;
  background: none;
  border: none;
  transition: background 0.2s;
  position: relative;
}
.icon-link:hover { background: #f0f0f0; color: #1a1a2e; }
.icon-label { margin-top: 2px; }
.cart-badge {
  position: absolute;
  top: 2px;
  right: 4px;
  background: #e74c3c;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
}

/* ─── Category Nav ─── */
.category-nav {
  background: #f7f7f7;
  border-top: 1px solid #e0e0e0;
}
.category-nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  gap: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.category-nav-inner::-webkit-scrollbar { display: none; }

/* ─── 初めての方バナー ─── */
.firsttime-banner {
  background: linear-gradient(135deg, #1a1a2e 0%, #2d2d5e 100%);
  color: #fff;
  padding: 1.5rem 1rem;
}
.firsttime-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}
.firsttime-text { flex: 1; min-width: 240px; }
.firsttime-headline {
  font-size: 0.95rem;
  margin: 0 0 0.8rem;
  color: #ddd;
  line-height: 1.6;
}
.firsttime-cta-btn {
  display: inline-block;
  background: #fff;
  color: #1a1a2e;
  font-weight: 700;
  font-size: 1rem;
  padding: 0.75rem 2rem;
  border-radius: 30px;
  text-decoration: none;
  transition: all 0.2s;
}
.firsttime-cta-btn:hover {
  background: var(--primary, #6c5ce7);
  color: #fff;
}
.firsttime-note {
  margin: 0.5rem 0 0;
  font-size: 0.78rem;
  color: #aaa;
}
.firsttime-stats {
  display: flex;
  gap: 2rem;
  list-style: none;
  padding: 0;
  margin: 0;
  flex-wrap: wrap;
}
.firsttime-stats li {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.stat-number {
  font-size: 1.3rem;
  font-weight: 700;
  color: #fff;
  font-family: 'Outfit', sans-serif;
}
.stat-label {
  font-size: 0.72rem;
  color: #aaa;
  margin-top: 2px;
}

/* ─── Footer enhanced ─── */
.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
  text-align: center;
}
.footer-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.8rem;
}
.footer-links a {
  color: #999;
  text-decoration: none;
  font-size: 0.82rem;
}
.footer-links a:hover { color: #fff; }
.footer-copy { color: #777; font-size: 0.78rem; margin: 0; }

/* ─── Register: Step Indicator ─── */
.reg-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 1.2rem 0 1.8rem;
  gap: 0;
}
.reg-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  opacity: 0.4;
  transition: opacity 0.2s;
}
.reg-step.active,
.reg-step.done { opacity: 1; }
.step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #ddd;
  color: #666;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  transition: all 0.2s;
}
.reg-step.active .step-num {
  background: #1a1a2e;
  color: #fff;
}
.reg-step.done .step-num {
  background: #27ae60;
  color: #fff;
}
.step-label { font-size: 0.72rem; color: #555; }
.reg-step-line {
  flex: 1;
  height: 2px;
  background: #e0e0e0;
  min-width: 40px;
  max-width: 80px;
}

/* Step Panels */
.reg-step-panel { display: none; }
.reg-step-panel.active { display: block; }
.reg-step-title {
  font-size: 1rem;
  font-weight: 700;
  color: #1a1a2e;
  margin: 0 0 1.2rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #e0e0e0;
}

/* 事業形態カード */
.biztype-cards {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.biztype-card {
  flex: 1;
  min-width: 140px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  padding: 1.2rem 1rem;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}
.biztype-card input { display: none; }
.biztype-card:hover,
.biztype-card.selected {
  border-color: #1a1a2e;
  background: #f0f0f8;
}
.biztype-icon { font-size: 2rem; }
.biztype-name { font-weight: 700; font-size: 0.9rem; color: #1a1a2e; }
.biztype-desc { font-size: 0.78rem; color: #666; line-height: 1.4; }

/* Form helpers */
.form-hint { font-size: 0.75rem; color: #888; margin: 2px 0 4px; }
.auth-notice {
  background: #fff8e1;
  border-left: 4px solid #f39c12;
  padding: 0.8rem 1rem;
  border-radius: 4px;
  font-size: 0.85rem;
  color: #555;
  margin-bottom: 1.2rem;
  line-height: 1.6;
}
.auth-note { font-size: 0.78rem; color: #888; }
.auth-note a { color: var(--primary, #6c5ce7); }
.form-btn-row {
  display: flex;
  gap: 0.8rem;
  align-items: center;
  margin-top: 1rem;
}
.back-btn {
  background: none;
  border: 2px solid #ccc;
  color: #666;
  padding: 0.75rem 1.5rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s;
}
.back-btn:hover { border-color: #999; color: #333; }
.form-btn-row .submit-btn { flex: 1; }

/* required badge */
.required {
  background: #e74c3c;
  color: #fff;
  font-size: 0.65rem;
  padding: 1px 5px;
  border-radius: 3px;
  margin-left: 4px;
  font-weight: 600;
  vertical-align: middle;
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
  .topbar-inner { flex-direction: column; align-items: flex-start; gap: 2px; }
  .header-inner { flex-wrap: wrap; padding: 0.5rem; gap: 0.5rem; }
  .header-search { max-width: 100%; order: 3; width: 100%; flex: none; }
  .firsttime-inner { flex-direction: column; }
  .biztype-cards { flex-direction: column; }
  .reg-steps { gap: 0; }
}
