/* public/styles.css - External CSS for Performance Optimization */
/* Global theme tokens and base layout */
:root {
    --primary: #007aff;
    --primary-light: #5ac8fa;
    --primary-dark: #0051d5;
    --secondary: #1c1c1e;
    --success: #34c759;
    --warning: #ff9500;
    --danger: #ff3b30;
    --info: #17a2b8;
    --background: #f2f2f7;
    --background-gradient: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    --surface: #ffffff;
    --border: #e5e5ea;
    --border-light: #f2f2f7;
    --text-primary: #000000;
    --text-secondary: #6c6c70;
    --text-tertiary: #8e8e93;
    --text: var(--text-primary);
    --muted: var(--text-secondary);
    --text-muted: var(--text-secondary);
    --text-light: var(--text-tertiary);
    --shadow: rgba(0, 0, 0, 0.1);
    --shadow-m: rgba(0, 0, 0, 0.15);
    --shadow-h: rgba(0, 0, 0, 0.2);
    --radius: 15px;
    --radius-sm: 8px;
    --radius-lg: 25px;
    --transition: all 0.3s ease;
    --gradient: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    --gradient-s: linear-gradient(135deg, var(--secondary) 0%, var(--primary) 100%);
    --gradient-b: linear-gradient(135deg, #87ceeb 0%, #5f9ea0 100%);
    --gradient-l: linear-gradient(135deg, #e6e6fa 0%, #d8bfd8 100%);
    --gradient-lh: linear-gradient(135deg, #d8bfd8 0%, #dda0dd 100%);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--surface);
    background-color: var(--surface);
    color: var(--text-primary);
    min-height: 100vh;
    margin: 0;
    padding: clamp(6px, 2vw, 6px);
    overflow-y: auto;
}

/* Generic cards + cooking steps */
.card {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    min-height: 240px;
}

.card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border-color: var(--border);
    transform: translateY(-2px);
}

.card h3 {
    margin: 0 0 16px;
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.01em;
}

.steps-container {
    margin-bottom: 24px;
}

.step-progress {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
    position: relative;
}

.step-progress::before {
    content: '';
    position: absolute;
    top: 16px;
    left: 16px;
    right: 16px;
    height: 2px;
    background: var(--border);
    z-index: 1;
}

.step-progress-line {
    position: absolute;
    top: 16px;
    left: 16px;
    height: 2px;
    background: var(--gradient);
    transition: width 0.3s ease;
    z-index: 2;
}

.step-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--surface);
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
    transition: var(--transition);
    z-index: 3;
    position: relative;
}

.step-dot:hover {
    transform: scale(1.1);
    border-color: var(--primary);
}

.step-dot.completed {
    background: var(--gradient-l);
    border-color: #d8bfd8;
    color: #4b0082;
}

.step-dot.active {
    background: var(--gradient);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
}

.step-dot.active::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    width: 3px;
    height: 60px;
    background: linear-gradient(180deg, var(--primary) 0%, rgba(0, 122, 255, 0.3) 50%, transparent 100%);
    transform: translateX(-50%);
    z-index: -1;
    border-radius: 2px;
}

.steps-scroll-container {
    position: relative;
    margin: 0 -20px;
    padding: 0 20px;
}

.steps-row {
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    padding: 20px 0;
}

.steps-slider {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    padding: 6px 0;
    flex: 1;
    cursor: grab;
}

.steps-slider:active {
    cursor: grabbing;
}

.steps-slider::-webkit-scrollbar {
    height: 6px;
}

.steps-slider::-webkit-scrollbar-track {
    background: var(--background);
    border-radius: 10px;
}

.steps-slider::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 10px;
}

.step-card {
    flex: 0 0 calc(37.5% - 60px);
    min-width: calc(37.5% - 60px);
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    transition: var(--transition);
    opacity: 0.5;
    transform: scale(0.95);
    position: relative;
    cursor: pointer;
}

.step-card:hover {
    opacity: 0.7;
    border-color: var(--primary);
}

.step-card.active {
    opacity: 1;
    transform: scale(1);
    border-color: var(--primary);
    box-shadow: 0 8px 24px rgba(0, 122, 255, 0.15);
}

.step-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.step-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.4;
    flex: 1;
    min-width: 0;
}

.step-time-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 500;
    padding: 2px 14px;
    border-radius: 20px;
    background: var(--background);
    border: 1px solid var(--border);
    font-variant-numeric: tabular-nums;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.step-time-indicator:hover {
    background: var(--surface);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.15);
}

.step-time-indicator.active {
    background: var(--gradient-l);
    border-color: #D8BFD8;
    color: #4B0082;
}

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

.step-time-indicator .timer-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

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

    100% {
        left: 100%;
    }
}

.step-instructions {
    margin-bottom: 16px;
    line-height: 1.6;
}

.step-products {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    flex-wrap: wrap;
    margin-bottom: 16px;
    padding: 14px;
    background: var(--background);
    border-radius: 12px;
}

.step-product-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    max-width: 100px;
}

.step-product-thumb {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: var(--transition);
    background: white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.step-product-thumb:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.2);
    border-color: var(--primary);
}

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

.step-product-placeholder {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.3;
    display: block;
    padding: 12px;
}

.step-product-name {
    font-size: 12px;
    color: var(--text-secondary);
    text-align: center;
    line-height: 1.3;
    font-weight: 400;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.step-tips li.placeholder {
    color: var(--text-tertiary);
    font-style: italic;
}

.checkpoint {
    padding: 12px 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.6;
    font-style: italic;
}

.step-tips {
    margin-top: 24px;
    padding: 20px;
    background: var(--background);
    border-radius: 12px;
    border: 1px solid var(--border);
}

.step-tips h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 12px;
}

.step-tips ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 8px;
}

.step-tips li {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary);
}

.hero-metadata {
    display: grid;
    gap: 10px;
    font-size: 13px;
    margin-top: 8px;
}

.hero-meta-row {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 12px;
    align-items: baseline;
}

.hero-meta-label {
    color: var(--text-tertiary);
    font-weight: 500;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
}

.hero-meta-value {
    color: var(--text);
    font-weight: 500;
}

.hero-tagline {
    font-size: 16px;
    font-weight: 500;
    color: var(--primary);
    margin: 4px 0 8px 0;
}

.hero-description {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary);
    margin: 0;
}

.hero-tags-section {
    margin-top: 12px;
}

.hero-tags-label {
    color: var(--text-tertiary);
    font-weight: 500;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    display: block;
}

.hero-tag {
    display: inline-block;
    padding: 4px 12px;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
    transition: var(--transition);
    cursor: pointer;
}

.hero-tag:hover {
    background: var(--surface);
    border-color: var(--primary);
}

.hero {
    padding: 0;
    background: var(--surface);
}

.hero-wrap {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    padding: 28px 24px;
    align-items: stretch;
    max-width: 1400px;
    margin: 0 auto;
}

.hero-media {
    height: 470px;
    border-radius: var(--radius);
    background: var(--background);
    border: 1px solid var(--border-light);
    overflow: hidden;
    position: relative;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.hero-media .badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--gradient);
    padding: 6px 14px;
    border-radius: 999px;
    box-shadow: 0 4px 14px rgba(0, 122, 255, 0.3);
    backdrop-filter: blur(6px);
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    z-index: 10;
}

.hero-info {
    display: flex;
    flex-direction: column;
    gap: 16px;
    justify-content: space-between;
}

.hero-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.hero-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.title {
    margin: 0 0 8px 0;
    font-size: clamp(28px, 3.8vw, 42px);
    line-height: 1.15;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
}

.shop-cta {
    display: block;
    width: 100%;
    margin-top: auto;
    padding: 12px 20px;
    background: var(--gradient);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 12px rgba(0, 122, 255, .3);
}

.shop-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 122, 255, .4);
}

.cooking-layout {
    background: var(--surface);
    min-height: 100vh;
}

.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    background: var(--surface);
}

.content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: stretch;
    margin-bottom: 24px;
}

.subtle {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.6;
}

.step-ingredients-list {
    margin: 12px 0;
    padding-left: 20px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary);
}

.product {
    flex: 0 0 280px;
    min-width: 240px;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
    border: 1px solid var(--border);
    min-height: 520px;
    flex-shrink: 0;
    margin-bottom: 20px;
}

.product-image-link {
    display: block;
    height: 180px;
    background: var(--background);
    position: relative;
    overflow: hidden;
    text-decoration: none;
}

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

.vendor-options {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 8px 0;
    min-height: 210px;
}

.vendor-option {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px;
    border: 2px solid var(--border-light);
    border-radius: 8px;
    background: var(--surface);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.vendor-option.selected {
    border-color: rgba(0, 122, 255, 0.5);
    background: rgba(0, 122, 255, 0.05);
}

.vendor-icon {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    border-radius: 3px;
    object-fit: contain;
    flex-shrink: 0;
}

.vendor-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 0;
}

.vendor-name {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
}

.vendor-product-title {
    font-size: 12px;
    line-height: 1.3;
    color: var(--text);
    font-weight: 500;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.shop {
    margin-top: 48px;
    margin-bottom: 48px;
    padding: 32px 24px;
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.03) 0%, rgba(0, 122, 255, 0.01) 100%);
    border: 2px solid var(--primary);
    border-radius: var(--radius);
    box-shadow: 0 8px 32px rgba(0, 122, 255, 0.12);
    position: relative;
    transition: var(--transition);
}

.shop::before {
    content: '';
    position: absolute;
    top: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 2px;
    background: var(--gradient);
    border-radius: 2px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.shop:hover {
    border-color: transparent;
}

.shop:hover::before {
    opacity: 1;
}

.shop h3 {
    margin: 0 0 24px;
    font-size: 24px;
    font-weight: 600;
    color: var(--text);
}

/* Product title in shop section - larger font size */
.shop .product .product-title,
.shop .product h4.product-title,
.shop .product h4 {
    font-size: 17px;
    line-height: 1.4;
    height: auto;
    min-height: auto;
    margin-bottom: 8px;
}

.nutrition {
    margin-top: 32px;
}

.nutri {
    width: 100%;
    border-collapse: collapse;
}

.nutri th,
.nutri td {
    border: 1px solid var(--border);
    padding: 10px 14px;
    text-align: left;
    font-size: 14px;
}

.nutri th {
    background: var(--background);
    font-weight: 600;
    color: var(--text);
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
    width: 35%;
    border-right: 1px solid var(--border);
}

.nutri td {
    color: var(--text-secondary);
    width: 65%;
}

.tips {
    margin-top: 32px;
}

.tips .card ul {
    padding-left: 24px;
    font-size: 14px;
    color: var(--text-secondary);
}

.tips .card li {
    margin-bottom: 8px;
    line-height: 1.6;
}

/* Cooking layout mobile styles - consolidated to single breakpoint */
/* Detail Product Layout Styles */
.detail-product {
    /* Theme tokens (override theo brand nếu muốn) */
    --dp-bg: #f5f7fb;
    --dp-panel: #ffffff;
    --dp-text: #1f2933;
    --dp-sub: #52606d;
    --dp-muted: #7b8794;
    --dp-border: #d7e0eb;
    --dp-accent: #2563eb;
    /* đổi theo brand: #16a34a, #22c55e, #6366f1… */
    --dp-accent-2: color-mix(in oklab, var(--dp-accent) 40%, #93c5fd 60%);
    --dp-contrast: #edf2ff;
    --dp-success: #047857;
    --dp-danger: #dc2626;
    background: var(--dp-panel);
    color: var(--dp-text);
    border: 1px solid var(--dp-border);
    border-radius: 16px;
    padding: clamp(18px, 2vw, 28px);
    display: grid;
    grid-template-columns: minmax(260px, 44%) 1fr;
    gap: clamp(18px, 2.5vw, 34px);
    box-shadow: 0 12px 40px rgba(44, 82, 130, 0.12);
    position: relative;
}

.detail-product .dp-left,
.detail-product .dp-right {
    min-width: 0;
}

.detail-product .dp-media {
    position: sticky;
    top: 16px;
}

.detail-product .dp-media--empty {
    height: clamp(240px, 36vw, 500px);
    border-radius: 14px;
    background: linear-gradient(180deg, #f1f5f9, #e2e8f0);
    border: 1px dashed var(--dp-border);
}

.detail-product .dp-image {
    position: relative;
    overflow: hidden;
    border-radius: 14px;
    border: 1px solid var(--dp-border);
    background: white;
}

.detail-product .dp-image img {
    width: 100%;
    height: clamp(240px, 36vw, 500px);
    object-fit: contain;
    display: block;
    transition: transform .4s ease;
    image-rendering: -webkit-optimize-contrast;
}

.detail-product .dp-image:hover img {
    transform: scale(1.02);
}

.detail-product .dp-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 10px;
    margin: 2px 0 10px;
    font-size: 12px;
    color: var(--dp-muted);
}

.detail-product .dp-breadcrumb .crumb {
    opacity: .9;
}

.detail-product .dp-breadcrumb .sep {
    opacity: .35;
    margin: 0 2px;
}

.detail-product .dp-title {
    margin: 2px 0 8px;
    font-size: clamp(22px, 2.4vw, 30px);
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: .2px;
    color: var(--dp-text);
}

.detail-product .dp-sub {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
    align-items: center;
    color: var(--dp-sub);
    font-size: 13px;
}

.detail-product .dp-brand {
    opacity: .95;
}

.detail-product .dp-store-section {
    margin-top: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: flex-start;
}

.detail-product .dp-mall {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--dp-muted);
}

.detail-product .dp-mall-fav {
    width: 14px;
    height: 14px;
    border-radius: 3px;
}

.detail-product .dp-store-link {
    display: inline-flex;
    align-items: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--dp-accent);
    text-decoration: none;
}

.detail-product .dp-store-link:hover {
    color: color-mix(in oklab, var(--dp-accent) 70%, #1d4ed8 30%);
}

.detail-product .dp-price {
    margin: 16px 0 12px;
    display: flex;
    align-items: center;
    gap: 12px 20px;
    flex-wrap: wrap;
}

.detail-product .dp-price-main {
    display: flex;
    gap: 12px;
    align-items: baseline;
}

.detail-product .dp-high {
    text-decoration: line-through;
    color: var(--dp-muted);
    font-size: clamp(14px, 1.2vw, 15px);
}

.detail-product .dp-low {
    font-size: clamp(22px, 2.2vw, 28px);
    font-weight: 800;
    letter-spacing: .2px;
    color: var(--dp-accent);
}

.detail-product .dp-stock {
    margin-left: auto;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    border: 1px solid var(--dp-border);
    background: #f8fafc;
}

.detail-product .dp-stock.in {
    color: var(--dp-success);
    border-color: color-mix(in oklab, var(--dp-success) 50%, #c7f0dd 50%);
}

.detail-product .dp-stock.out {
    color: var(--dp-danger);
    border-color: color-mix(in oklab, var(--dp-danger) 40%, #fecaca 60%);
}

.detail-product .dp-stock.unknown {
    color: var(--dp-muted);
    border-style: dashed;
    border-color: color-mix(in oklab, var(--dp-muted) 40%, #cbd5f5 60%);
    background: rgba(226, 232, 240, 0.4);
}

.detail-product .dp-actions {
    margin: 18px 0;
}

.detail-product .dp-actions .dp-buy {
    appearance: none;
    cursor: pointer;
    text-align: center;
    width: 100%;
    padding: 14px 18px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 16px;
    background: linear-gradient(90deg, var(--dp-accent), var(--dp-accent-2));
    color: #fff;
    border: none;
    box-shadow: 0 12px 24px rgba(37, 99, 235, 0.28);
    transition: transform .12s ease, box-shadow .2s ease, filter .2s ease;
    user-select: none;
}

.detail-product .dp-actions .dp-buy:hover {
    filter: saturate(1.05);
    transform: translateY(-1px);
    box-shadow: 0 16px 30px rgba(37, 99, 235, 0.32);
}

.detail-product .dp-actions .dp-buy:active {
    transform: translateY(0);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.24);
}

.detail-product .dp-info {
    border-top: 1px solid var(--dp-border);
    padding-top: 18px;
}

.detail-product .dp-highlights {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.detail-product .dp-highlight {
    background: var(--dp-contrast);
    border: 1px solid color-mix(in oklab, var(--dp-border) 60%, #dbeafe 40%);
    border-radius: 12px;
    padding: 14px 16px;
    display: grid;
    gap: 4px;
}

.detail-product .dp-highlight-label {
    font-size: 12px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    color: var(--dp-muted);
    font-weight: 600;
}

.detail-product .dp-highlight-value {
    font-size: 16px;
    color: var(--dp-text);
    white-space: normal;
    word-break: break-word;
}

.detail-product .dp-highlight--description {
    grid-column: 1 / -1;
}

/* Description styling for highlight section */
.detail-product .dp-highlight--description .dp-highlight-value {
    color: var(--dp-text);
    line-height: 1.6;
    font-size: 14.5px;
    white-space: normal;
}

/* Normalize all text sizes and spacing */
.detail-product .dp-highlight--description .dp-highlight-value * {
    font-size: 14.5px !important;
    line-height: 1.6;
}

.detail-product .dp-highlight--description .dp-highlight-value ul,
.detail-product .dp-highlight--description .dp-highlight-value ol {
    padding-left: 18px;
    margin: 8px 0;
}

.detail-product .dp-highlight--description .dp-highlight-value li {
    margin: 4px 0;
    line-height: 1.5;
}

/* Paragraphs with normalized spacing */
.detail-product .dp-highlight--description .dp-highlight-value p {
    margin: 8px 0;
    color: var(--dp-text);
}

/* Remove spacing from empty paragraphs (like <p><br></p>) */
.detail-product .dp-highlight--description .dp-highlight-value p:empty {
    margin: 0;
    height: 0;
    display: none;
}

/* Handle paragraphs that only contain line breaks - more compatible approach */
.detail-product .dp-highlight--description .dp-highlight-value p br {
    display: none;
}

/* Additional rule for paragraphs with only whitespace and br */
.detail-product .dp-highlight--description .dp-highlight-value p:only-child {
    margin: 0;
}

.detail-product .dp-highlight--description .dp-highlight-value p:first-child {
    margin-top: 0;
}

.detail-product .dp-highlight--description .dp-highlight-value p:last-child {
    margin-bottom: 0;
}

.detail-product .dp-highlight--description .dp-highlight-value p+p {
    margin-top: 8px;
}

.detail-product .dp-highlight--description .dp-highlight-value a {
    color: var(--dp-accent);
    text-decoration: none;
    border-bottom: 1px dashed color-mix(in oklab, var(--dp-accent) 45%, transparent);
}

.detail-product .dp-highlight--description .dp-highlight-value a:hover {
    border-bottom-style: solid;
}

/* Section styling */
.detail-product .dp-section {
    margin-bottom: 24px;
    padding: 18px;
    background: #f8fbff;
    border-radius: 14px;
    border: 1px solid var(--dp-border);
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    animation: slideInUp 0.4s ease-out;
}

.detail-product .dp-section:hover {
    background: #eef5ff;
    border-color: color-mix(in oklab, var(--dp-accent) 45%, var(--dp-border) 55%);
}

.detail-product .dp-section-title {
    margin: 0 0 12px 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--dp-text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.detail-product .dp-section-title::before {
    content: '';
    width: 4px;
    height: 16px;
    background: linear-gradient(180deg, var(--dp-accent), var(--dp-accent-2));
    border-radius: 2px;
}

.detail-product .dp-specs {
    display: grid;
    gap: 12px;
}

.detail-product .dp-specs--two-column {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}

.detail-product .dp-specs-column {
    display: contents;
}

.detail-product .kv {
    display: grid;
    grid-template-columns: 30% 70%;
    gap: 8px;
    align-items: baseline;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
    border-right: 1px solid rgba(148, 163, 184, 0.18);
}

.detail-product .kv:nth-child(even) {
    border-right: none;
}

/* Remove bottom border from last row in two-column grid */
.detail-product .dp-specs--two-column .kv:nth-last-child(-n+2) {
    border-bottom: none;
}

/* Fallback for single column layout */
.detail-product .dp-specs:not(.dp-specs--two-column) .kv:last-child {
    border-bottom: none;
}

.detail-product .kv .k {
    color: var(--dp-muted);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-right: 0;
    padding-right: 4px;
}

.detail-product .kv .v {
    color: var(--dp-text);
    font-size: 14px;
    line-height: 1.4;
    word-break: break-word;
    padding-left: 4px;
}

.detail-product a:focus-visible,
.detail-product button:focus-visible {
    box-shadow: 0 0 0 3px color-mix(in oklab, var(--dp-accent) 30%, transparent);
}

.detail-product .dp-discount {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    margin-left: 8px;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.detail-product button:focus-visible {
    box-shadow: 0 0 0 3px color-mix(in oklab, var(--dp-accent) 30%, transparent);
}

.detail-product .dp-header {
    padding-bottom: 10px;
    border-bottom: 1px solid var(--dp-border);
    margin-bottom: 10px;
    box-shadow: 0 2px 0 0 color-mix(in oklab, var(--dp-accent) 18%, transparent);
}

.detail-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.detail-popup-overlay.active {
    opacity: 1;
    visibility: visible;
}

.detail-popup-container {
    background: var(--dp-panel);
    border-radius: 16px;
    border: 1px solid var(--dp-border);
    box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
    width: 90vw;
    max-width: 1100px;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
    position: relative;
}

.detail-popup-overlay.active .detail-popup-container {
    transform: scale(1) translateY(0);
}

.detail-popup-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: transparent;
    border: 1px solid var(--dp-border);
    color: var(--dp-text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    z-index: 10001;
    transition: all 0.2s ease;
}

.detail-popup-close:hover {
    background: rgba(0, 0, 0, 0.1);
    transform: scale(1.05);
}

.detail-popup-content {
    padding: 24px;
    overflow-y: auto;
    max-height: calc(90vh - 48px);
}

.detail-popup-content::-webkit-scrollbar {
    width: 6px;
}

.detail-popup-content::-webkit-scrollbar-track {
    background: transparent;
}

.detail-popup-content::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.3);
    border-radius: 3px;
}

.detail-popup-content::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.5);
}

.detail-product .dp-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--dp-accent), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.detail-product .dp-section:hover::before {
    opacity: 0.6;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.detail-product .dp-section:nth-child(1) {
    animation-delay: 0.1s;
}

.detail-product .dp-section:nth-child(2) {
    animation-delay: 0.2s;
}

.detail-product .dp-section:nth-child(3) {
    animation-delay: 0.3s;
}

.detail-product .dp-section:nth-child(4) {
    animation-delay: 0.4s;
}

.detail-product .dp-section:nth-child(5) {
    animation-delay: 0.5s;
}

.clarification-container,
.clarification-form {
    background: white;
    border-radius: 20px;
    box-shadow: 0 4px 20px var(--shadow);
    padding: 30px;
    max-width: 672px;
    margin: 40px auto;
    text-align: center;
}

.clarification-form {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border);
}

.clarification-form::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient);
}

.clarification-header {
    margin-bottom: 25px;
    text-align: center;
}

.clarification-title,
.clarification-header h3 {
    font-size: 1.5rem;
    color: var(--text);
    font-weight: 600;
    margin: 0 0 12px 0;
    line-height: 1.3;
}

.clarification-header p {
    color: var(--text-muted);
    font-size: 1em;
    line-height: 1.5;
    margin: 0;
}

.clarification-body {
    margin-bottom: 25px;
}

.clarification-options {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin-bottom: 20px;
}

.clarify-option {
    background: var(--light);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 20px;
    cursor: pointer;
    transition: var(--transition);
    font-size: 14px;
    color: var(--text);
    min-width: 120px;
}

.clarify-option:hover {
    border-color: var(--primary);
    background: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow);
}

.clarify-option.selected {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow-m);
}

.clarification-empty {
    color: var(--text-muted);
    font-style: italic;
    padding: 20px;
}

.clarification-custom-input {
    margin-top: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.clarification-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.clarification-text-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

.clarification-text-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.clarification-text-input::placeholder {
    color: #999;
    font-style: italic;
}

.clarification-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 30px;
    padding-top: 25px;
    border-top: 1px solid var(--border);
}

.clarify-submit,
.clarification-actions .btn-submit {
    background: var(--gradient);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    padding: 12px 30px;
    font-size: 16px;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
    min-width: 120px;
    text-transform: none;
}

.clarify-submit:hover:not(:disabled),
.clarification-actions .btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow-m);
}

.clarify-submit:disabled {
    background: var(--text-light);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.clarification-actions .btn-cancel {
    padding: 12px 30px;
    background: var(--light);
    color: var(--text);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    min-width: 100px;
}

.clarification-actions .btn-cancel:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.header-buttons {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 0px;
    min-height: 44px;
    justify-content: flex-start;
    padding-left: 0;
}

.header-content {
    text-align: center;
    margin-top: 0px;
}

.search-container {
    display: flex;
    gap: 12px;
    position: relative;
    width: 100%;
    box-sizing: border-box;
    align-items: center;
    flex-wrap: nowrap;
}

.search-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    position: relative;
    box-sizing: border-box;
}

.search-input-container {
    position: relative;
    flex: 1;
    width: 100%;
    min-width: 0;
    display: block;
    padding: 4px;
    cursor: text;
}

.search-button,
.ai-button {
    border: none;
    cursor: pointer;
    border-radius: 50px;
    font-size: 16px;
    white-space: nowrap;
    transition: var(--transition), background 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    flex-shrink: 0;
}

.search-button {
    background: var(--text-primary);
    color: var(--surface);
    padding: 12px 24px;
    gap: 8px;
    min-width: 48px;
    height: 48px;
}

.ai-button {
    background: linear-gradient(135deg, var(--secondary) 0%, var(--primary) 100%);
    color: white;
    padding: 12px 12px;
    width: 44px;
    min-width: 44px;
    height: 44px;
}

.search-button.ai-progress {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff;
    min-width: 120px;
    position: relative;
    overflow: hidden;
}

.search-button.ai-progress:hover {
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    box-shadow: 0 5px 15px rgba(0, 122, 255, 0.3);
}

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

.search-button:hover,
.ai-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(52, 152, 219, 0.3);
}

.search-button:active,
.ai-button:active {
    transform: translateY(0);
    box-shadow: 0 5px 10px rgba(52, 152, 219, 0.2);
}

.ai-button svg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.clear-search {
    position: absolute;
    right: 16px;
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    z-index: 10;
    min-width: 28px;
    min-height: 28px;
    margin-right: 0;
    flex-shrink: 0;
}

.clear-search:hover {
    background: var(--background);
    color: var(--text-primary);
}

.clear-search svg {
    width: 18px;
    height: 18px;
}

/* When button is in AI progress state, hide the clear button */
.search-form .search-button.ai-progress~.clear-search,
.search-form .search-button.ai-progress+.clear-search {
    display: none;
}

.clear-search:active {
    transform: scale(0.95);
}

.clear-search svg {
    width: 18px;
    height: 18px;
}

.results-section {
    padding: 0;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 20px;
}

.product-card {
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 8px 25px var(--shadow);
    transition: var(--transition);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    height: 460px;
    /* Fixed height for consistency */
    min-height: 420px;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px var(--shadow-m);
}

.product-image {
    height: 180px;
    overflow: hidden;
    background: var(--light);
    position: relative;
    flex-shrink: 0;
    cursor: pointer;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-card.vendor-filter-hidden {
    display: none !important;
}

/* Unified cart item image sizing */
.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-info {
    padding: 15px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    min-height: 0;
    overflow: hidden;
}

.product-content {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-height: 0;
    overflow: hidden;
}

.product-brand {
    background: var(--gradient-b);
    color: white;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    text-align: center;
    height: 20px;
    line-height: 14px;
    flex-shrink: 0;
}

.product-title {
    font-size: 0.9rem;
    color: var(--text);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 5px;
    flex-shrink: 0;
    height: 4.5rem;
}

.product-price {
    font-size: 1.1rem;
    font-weight: bold;
    margin: 0;
}

.product-details {
    height: 60px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex-shrink: 0;
}

.product-mall,
.product-maker {
    color: var(--text-secondary);
    line-height: 16px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
    overflow-wrap: anywhere;
    height: auto;
    max-height: 32px;
}

.product-mall {
    font-size: 0.8rem;
    font-weight: 500;
}

.product-maker {
    font-size: 0.75rem;
    font-style: italic;
}

.product-category {
    color: var(--text-secondary);
    font-size: 0.7rem;
    display: inline-block;
    height: 16px;
    line-height: 12px;
    width: fit-content;
    white-space: nowrap;
}

.stickyCurrentLanguage {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.sticky-header .search-container {
    display: none;
}

.sticky-header .search-input-container {
    position: relative;
    flex: 1;
}

.sticky-header .search-input {
    width: 100%;
    padding-right: 56px;
}

.sticky-header .clear-search {
    position: absolute;
    right: 0px;
    top: 10px;
    /* Position at top, aligned with first line of text */
    transform: none;
    /* Remove centering transform */
    z-index: 10;
}

.sticky-header .language-dropdown {
    display: none;
}

.header-spacer {
    height: 0;
    transition: height 0.3s ease;
}

.sticky-header.active~.header-spacer {
    height: 80px;
}

/* Language and Cart buttons - unified styling */
.language-button,
.cart-button {
    position: relative;
    z-index: 1000;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    min-width: 44px;
    margin-right: 0;
    padding: 0;
    background: transparent;
    border: none;
    transition: var(--transition);
    cursor: pointer;
}

.language-button:hover,
.cart-button:hover {
    transform: translateY(-2px);
}

.language-dropdown {
    position: relative;
    z-index: 1000;
}

.language-button svg,
.cart-button svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.cart-badge {
    position: absolute;
    top: -1px;
    right: 1px;
    background: #D8BFD8;
    color: #4B0082;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    line-height: 1;
    pointer-events: none;
}

.language-dropdown-content {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
    min-width: 172px;
    padding: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--transition);
    margin-top: 8px;
}

.language-dropdown.active .language-dropdown-content {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.language-option {
    padding: 10px 12px;
    cursor: pointer;
    transition: var(--transition);
    border-radius: 8px;
    margin: 4px;
    color: var(--text);
    font-weight: 500;
    font-size: 0.9rem;
}

/* Header styles */
.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 300;
}

.header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Product card styles */
/* product-type-badge removed from thumbnail */
.product-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.1);
    opacity: 0;
    transition: var(--transition);
    border-radius: var(--radius) var(--radius) 0 0;
}

.product-image:hover::after {
    opacity: 1;
}

.product-image:hover img,
.product-card:hover .product-image img {
    transform: scale(1.05);
}

/* Source favicon on product image */
.product-card .product-image {
    position: relative;
}

.product-card .product-image .source-favicon {
    position: absolute;
    left: 6px;
    top: 6px;
    width: 25px;
    height: 25px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
    object-fit: contain;
    padding: 2px;
}

.product-high-price {
    font-size: 0.8rem;
    color: var(--text-light);
    text-decoration: line-through;
    margin-bottom: 0;
}

.buy-it-card-btn {
    background: var(--gradient-l) !important;
    color: #4B0082 !important;
    border: 1px solid #D8BFD8 !important;
    cursor: pointer;
    margin-top: auto !important;
    width: 100% !important;
    padding: 10px 15px !important;
    border-radius: var(--radius-sm) !important;
    font-size: 0.9rem !important;
    font-weight: 500 !important;
    transition: var(--transition) !important;
    text-align: center !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
    flex-shrink: 0;
}

.buy-it-card-btn:hover {
    background: var(--gradient-lh) !important;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(216, 191, 216, 0.4);
}

.modal,
.cart-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 50px auto;
    border-radius: var(--radius);
    width: 100%;
    max-width: 1280px;
    height: calc(100vh - 100px);
    box-shadow: 0 25px 50px var(--shadow-h);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header,
.cart-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    background: var(--gradient-s);
    color: white;
}

.modal-header {
    padding: 20px 30px;
    border-radius: var(--radius) var(--radius) 0 0;
}

.cart-modal-header {
    padding: 25px 30px;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 500;
}

.modal-title-container {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.modal-title-link {
    display: inline-flex;
    align-items: center;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.modal-title-link:hover {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    transform: scale(1.05);
}

.url-icon {
    width: 16px;
    height: 16px;
    opacity: 0.8;
    transition: opacity 0.2s ease;
    margin-right: 5px;
}

.modal-title-link:hover .url-icon {
    opacity: 1;
}

.modal-close,
.cart-modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
}

.modal-close:hover,
.cart-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.modal-body {
    height: calc(100% - 80px);
    position: relative;
}

.modal-iframe {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 0 0 var(--radius) var(--radius);
}

/* Cart modal styles */
/* (overlay styles unified with .modal above) */
.cart-modal-content {
    background-color: white;
    margin: 20px auto;
    border-radius: var(--radius);
    width: 95%;
    max-width: 1000px;
    max-height: calc(100vh - 40px);
    box-shadow: 0 25px 50px var(--shadow-h);
    animation: modalSlideIn 0.3s ease-out;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.cart-modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

/* (close button styles unified with .modal-close above) */
.cart-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.cart-section {
    padding: 30px;
    border-bottom: 1px solid var(--border);
}

.cart-section:last-child {
    border-bottom: none;
}

.cart-section-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

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

.cart-items {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.cart-delete-btn {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    border-radius: 4px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: normal;
}

.cart-delete-btn:hover {
    background: #f8f9fa;
    color: #dc3545;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: var(--gradient-l);
    border-radius: var(--radius);
    margin-top: 20px;
}

.cart-total-label {
    font-size: 1.2rem;
    font-weight: 600;
    color: #4B0082;
}

.cart-total-amount {
    font-size: 1.5rem;
    font-weight: bold;
    color: #4B0082;
}

.customer-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-label {
    font-weight: 600;
    color: var(--text);
    font-size: 0.95rem;
    min-width: 80px;
    flex-shrink: 0;
}

.form-input,
.form-textarea {
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    transition: var(--transition);
    width: 100%;
    box-sizing: border-box;
    flex: 1;
}

.form-input {
    padding: 12px 15px;
    font-size: 1rem;
}

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

.form-textarea {
    resize: vertical;
    min-height: 80px;
}

.form-error {
    color: #e74c3c;
    font-size: 0.8rem;
    margin-top: 5px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.empty-cart {
    text-align: center;
    padding: 60px 30px;
    color: var(--text-muted);
}

.empty-cart svg {
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-cart h3 {
    margin-bottom: 10px;
    color: var(--text);
}

/* Cart button styles */
.btn-cart {
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn-cart-primary {
    background: var(--gradient-l);
    color: #4B0082;
    border: 1px solid #D8BFD8;
}

.btn-cart-primary:hover {
    background: var(--gradient-lh);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(216, 191, 216, 0.4);
}

.btn-cart-secondary {
    background: #f8f9fa;
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-cart-secondary:hover {
    background: #e9ecef;
    transform: translateY(-1px);
}

.cart-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 20px;
    padding: 20px;
    border-top: 1px solid var(--border);
    background: #f8f9fa;
}

.multi-product-container {
    padding: 0 20px;
}

.product-row {
    margin-bottom: 40px;
    background: transparent;
    border-radius: var(--radius);
    box-shadow: none;
    overflow: hidden;
    transition: opacity 0.3s ease, max-height 0.3s ease;
}

.row-header {
    background: var(--gradient);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: var(--radius) var(--radius) 0 0;
}

.row-title {
    font-size: 1.2rem;
    margin: 0;
    font-weight: 600;
}

.row-category {
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
}

.row-badges {
    display: flex;
    align-items: center;
    gap: 0px;
    margin-top: 0;
    text-align: right;
    background: var(--gradient-l);
    padding: 6px 10px;
    border-radius: 9999px;
    box-shadow: 0 4px 12px var(--shadow-m);
    flex-wrap: wrap;
}

.row-badges .product-type-badge,
.row-badges .comparison-badge {
    display: inline-block;
    padding: 4px 2px;
    border-radius: 9999px;
    font-size: 0.8rem;
    line-height: 1;
    color: #0051D5;
    white-space: nowrap;
}

.row-container {
    display: flex;
    align-items: center;
    padding: 20px 0;
    position: relative;
    background: transparent;
}

.row-nav-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    z-index: 20;
    box-shadow: 0 4px 12px var(--shadow-m);
    transition: var(--transition);
    background: var(--gradient-s);
    color: white;
    border: none;
    cursor: pointer;
    opacity: 0.7;
}

.prev-row {
    left: 0;
}

.next-row {
    right: 0;
}

.row-nav-btn.hidden {
    display: none !important;
}

.row-nav-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.1);
}

.row-products {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 0;
    flex: 1;
    background: transparent;
    scrollbar-width: thin;
    -ms-overflow-style: auto;
    cursor: grab;
}

.row-products:active {
    cursor: grabbing;
}

.row-products::-webkit-scrollbar {
    height: 6px;
}

.row-products::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.row-products::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.row-products::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.row-products .product-card {
    width: 280px;
    min-width: 240px;
    flex-shrink: 0;
    margin-bottom: 20px;
}

.suggested-searches {
    background: white;
    border-radius: var(--radius);
    display: none;
}

.suggested-searches.active {
    display: block;
}

.suggested-header h3 {
    text-align: center;
    margin-bottom: 10px;
}

.suggested-header p {
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.5;
}

.suggested-tabs-container {
    position: relative;
    margin-bottom: 30px;
    max-width: 100%;
}

.suggested-tabs {
    display: flex;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 0;
}

.suggested-tabs::-webkit-scrollbar {
    display: none;
}

.tab-content {
    display: none;
}

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

.suggested-prompts {
    display: flex;
    flex-direction: column;
    max-width: 700px;
    margin: 0 auto;
    margin-top: 30px;
}

.suggested-prompt {
    cursor: pointer;
    transition: var(--transition);
    color: var(--text);
    text-align: left;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    min-height: 44px;
    font-size: 15px;
}

.suggested-prompt:hover {
    background: var(--background);
    border-color: var(--primary);
}

.suggested-prompt:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.prompt-content {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    border: none;
    outline: none;
}

.prompt-icon {
    display: none;
}

.prompt-text {
    flex: 1;
    line-height: 1.4;
    border: none;
    outline: none;
}

.prompt-arrow {
    margin-left: 10px;
    display: inline-block !important;
    width: 8px;
    height: 14px;
    color: #6C6C70;
    font-size: 0;
}

.prompt-arrow::after {
    content: '';
    display: inline-block;
    width: 8px;
    height: 14px;
    background-repeat: no-repeat;
    background-size: 100% 100%;
    background-image: url("data:image/svg+xml,%3Csvg width='8' height='14' viewBox='0 0 8 14' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 13L7 7L1 1' stroke='currentColor' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.suggested-prompt:hover .prompt-arrow {
    color: #000;
}

/* Icon-only search buttons when idle (keep text for AI states) */
#searchButton:not(.ai-progress),
#stickySearchButton:not(.ai-progress) {
    color: transparent;
    /* hide localized text */
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    gap: 0;
    border-radius: 9999px;
    /* fully rounded */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
    font-size: 0;
    /* collapse hidden text node so icon centers */
    overflow: hidden;
    /* ensure no stray text affects layout */
}

#searchButton:not(.ai-progress)::before,
#stickySearchButton:not(.ai-progress)::before {
    content: '';
    display: block;
    width: 28px;
    height: 28px;
    margin: 0;
    /* ensure centered */
    flex: none;
    /* don't stretch */
    background-repeat: no-repeat;
    background-size: 100% 100%;
    background-image: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5 12H19' stroke='%23FFFFFF' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M12 5L19 12L12 19' stroke='%23FFFFFF' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* Additional utility classes for inline styles replacement */
.order-link {
    color: #007bff;
    text-decoration: none;
}

.order-link:hover {
    text-decoration: underline;
}

.form-error-hidden,
.cart-badge-hidden,
.modal-iframe-hidden,
.lazy-load-hidden {
    display: none;
}

.loading-container {
    text-align: center;
    padding: 40px;
    color: #666;
}

.no-results {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.access-denied-container {
    text-align: center;
    padding: 50px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.access-denied-title {
    color: #e74c3c;
    margin-bottom: 20px;
}

.notification {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 10000;
    padding: 15px 20px;
    border-radius: 8px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    max-width: 300px;
    word-wrap: break-word;
    border: 1px solid;
}

.notification.show {
    transform: translateX(0);
}

/* Form Controls for Clarification */
.clarification-form-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.clarification-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
    margin-top: 20px;
    align-items: start;
}

.clarification-form .form-group label {
    font-weight: 600;
    color: var(--text);
    font-size: 1em;
    margin-bottom: 0px;
    overflow-wrap: anywhere;
}

.clarification-form .form-group .segmented-label {
    margin-bottom: 12px;
}

.clarification-form .form-group input,
.clarification-form .form-group select,
.clarification-form .form-group textarea {
    padding: 14px 18px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 16px;
    transition: var(--transition);
    background: white;
    width: 100%;
    box-sizing: border-box;
}

.clarification-form .form-group input:focus,
.clarification-form .form-group select:focus,
.clarification-form .form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* Form Controls */
.radio-option,
.checkbox-option {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 8px 0;
}

.radio-option input,
.checkbox-option input {
    margin: 0;
}

.radio-option label,
.checkbox-option label {
    margin: 0;
    font-weight: normal;
    cursor: pointer;
}

.segmented-control {
    display: flex;
    flex-wrap: wrap;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    width: 100%;
    margin-top: 8px;
}

.segmented-control input[type="radio"] {
    display: none;
}

.segmented-control label,
.segmented-control .segmented-option {
    flex: 0 0 33.333%;
    max-width: 33.333%;
    padding: 12px 20px;
    text-align: center;
    background: white;
    cursor: pointer;
    transition: var(--transition);
    margin: 0;
    font-weight: 500;
    font-size: 15px;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    text-transform: capitalize;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    word-break: keep-all;
}

.segmented-control input[type="radio"]:checked+label {
    background: var(--primary);
    color: white;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
    border-color: var(--primary);
}

.segmented-control label:hover {
    background: var(--light);
}

.segmented-control input[type="radio"]:checked+label:hover {
    background: var(--primary-dark);
}

/* Mobile Responsive for Clarification */
/* Agent3 Filtering Classes */
.agent3-visible {
    display: flex !important;
}

.agent3-hidden {
    display: none !important;
}

.product-row[data-agent3-empty="true"] {
    opacity: 0;
    max-height: 0;
    margin: 0;
    padding: 0;
}

/* ============================= Modern UI Overrides (Non-breaking) ============================= */
/* Modern palette and token remapping (see global :root above) */
.container {
    background: var(--surface);
    border: none;
    border-radius: 0;
    overflow: visible;
}

.header {
    background: rgba(255, 255, 255, 0.95);
    color: var(--text-primary);
    text-align: initial;
    position: sticky;
    top: 0;
    z-index: 40;
    border-bottom: 1px solid var(--border-light);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 0;
    transition: var(--transition);
}

.site-title {
    position: static;
    transform: none;
    color: var(--text-primary);
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-right: auto;
}

/* Make site title link clearly clickable and keep visual style */
.site-title a,
.sticky-header .site-title a {
    cursor: pointer;
    color: inherit;
    text-decoration: none;
}

.header-content {
    display: none;
}

/* Buttons defined above at line 1946 - no duplication needed */

.language-option .flag-icon {
    margin-right: 8px;
}


.search-section {
    max-width: 720px;
    margin: 0 auto;
    background: transparent;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.search-form {
    background: var(--surface);
    border-radius: 20px;
    padding: 8px;
    border: 1px solid var(--border);
    transition: var(--transition);
    cursor: text;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.search-form:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.search-form:focus-within {
    background: var(--surface);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1), 0 2px 8px rgba(0, 0, 0, 0.1);
}

.search-controls-row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    padding: 0 4px 0 4px;
    min-height: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.search-form.has-text .search-controls-row {
    opacity: 1;
    visibility: visible;
}

.search-active-badge {
    padding: 6px 12px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 400;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    flex-shrink: 0;
}
html[data-pro-allowed="0"] .search-active-badge {
    display: none;
}

.search-active-badge:hover {
    background: var(--background);
    border-color: var(--primary);
    color: var(--text);
}

.search-active-badge[data-active="true"] {
    background: var(--gradient);
    border-color: var(--primary);
    color: white;
    font-weight: 400;
}

.search-active-badge.disabled,
.search-active-badge:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.search-active-badge .badge-text {
    pointer-events: none;
}

.search-form .search-button {
    flex-shrink: 0;
    margin-left: auto;
}

.search-input:focus {
    outline: none;
    box-shadow: none;
}

.search-input::placeholder {
    color: var(--text-tertiary);
}

/* Textarea-specific styles - apply globally for PC and mobile */
textarea.search-input {
    min-height: calc(2 * 1.5em + 24px);
    max-height: 200px;
    height: auto;
    line-height: 1.5;
    resize: none !important;
    overflow-y: hidden;
    overflow-x: hidden;
    word-wrap: break-word;
    font-family: inherit;
    box-sizing: border-box;
    vertical-align: top;
    border: none;
    background: transparent;
    appearance: none;
    -webkit-appearance: none;
    padding: 12px 16px;
    padding-right: 48px;
    transition: height 0.1s ease;
    width: 100%;
    cursor: text;
    color: var(--text-primary);
}

textarea.search-input::placeholder {
    color: var(--text-tertiary);
    opacity: 0.8;
    font-weight: 400;
    font-style: normal;
}

textarea.search-input:focus {
    outline: none;
}

textarea.search-input::-webkit-resizer {
    display: none !important;
    visibility: hidden !important;
}

textarea.search-input::-moz-resizer {
    display: none !important;
    visibility: hidden !important;
}

.suggested-tab {
    background: var(--background);
    border: none;
    border-radius: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
    flex: 0 0 auto;
}

.suggested-tab.active {
    background: var(--text-primary);
    color: var(--surface);
}

.suggested-tab:hover:not(.active) {
    background: var(--border);
    color: var(--text-primary);
}

/* Product card subtle polish */






.product-price {
    color: var(--text-secondary);
}

.product-high-price {
    color: var(--text-tertiary);
}

.sticky-header {
    background: rgba(255, 255, 255, 0.95);
    border-bottom: 1px solid var(--border-light);
    padding: 12px 24px;
    gap: 2px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    align-items: flex-start;
    justify-content: space-between;
    flex-direction: column;
    transition: opacity 0.3s ease, transform 0.3s ease;
    display: flex;
    opacity: 0;
    transform: translateY(-100%);
    pointer-events: none;
}

.sticky-header.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

body.sticky-active .header .cart-button {
    display: none;
}

.sticky-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-bottom: 8px;
}

.sticky-header .site-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
}

.sticky-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sticky-header .search-container {
    margin: 0 auto;
    flex: 1;
}

.language-dropdown-content {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

.language-option:hover {
    background: var(--background);
    color: var(--primary);
}

.language-option.active {
    background: var(--background);
    color: var(--primary);
    pointer-events: none;
    opacity: 0.7;
}

.cart-button #cartButtonText,
.cart-button #stickyCartButtonText {
    display: none;
}

.notification-success {
    background: var(--success);
    color: #fff;
    border-color: transparent;
}

.notification-error {
    background: var(--danger);
    color: #fff;
    border-color: transparent;
}

.notification-warning {
    background: var(--warning);
    color: #fff;
    border-color: transparent;
}

.notification-info {
    background: var(--primary);
    color: #fff;
    border-color: transparent;
}

.product-card a {
    text-decoration: none;
    color: inherit;
}

.product-actions {
    margin-top: auto;
    margin-left: 16px;
    margin-right: 16px;
    margin-bottom: 16px;
}

.search-form.has-multiline .search-controls-row {
    margin-top: auto;
}

.product-mall .mall-favicon {
    width: 16px;
    height: 16px;
    display: inline-block;
    vertical-align: middle;
    margin-right: 6px;
    object-fit: contain;
}

.product-price-section {
    display: flex !important;
    gap: 8px;
    align-items: baseline;
    flex-shrink: 0;
}

.product-high-price {
    text-decoration: line-through !important;
    opacity: .75;
}

.vendor-badges-container {
    display: flex;
    gap: 8px;
    margin: 10px 0 0;
    padding: 0;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    align-items: center;
}

.vendor-badges-container::-webkit-scrollbar {
    height: 4px;
}

.vendor-badges-container::-webkit-scrollbar-track {
    background: transparent;
}

.vendor-badges-container::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 2px;
}

.vendor-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 8px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-primary);
    font-size: 10px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
    white-space: nowrap;
    min-height: 25px;
    flex-shrink: 0;
}

.vendor-badge:hover {
    transform: translateY(-1px);
}

.vendor-badge.inactive {
    background: #E5E5EA;
    color: #8E8E93;
}

.vendor-badge-favicon {
    width: 11px;
    height: 11px;
    object-fit: contain;
    flex-shrink: 0;
}

.vendor-badge-name {
    font-weight: 500;
    line-height: 1;
}

/* Mobile responsive */
/* Toast notifications */
#toastHost {
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 8px
}

.toast {
    min-width: 220px;
    max-width: 360px;
    padding: 10px 14px;
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .2);
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity .18s ease, transform .18s ease
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast-info {
    background: rgba(52, 152, 219, .9);
}

.toast-success {
    background: rgba(46, 204, 113, .9);
}

.toast-error {
    background: rgba(231, 76, 60, .9);
}

.toast-warning {
    background: rgba(243, 156, 18, .9);
}

/* Loading animations */
@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }
}

/* Responsive Styles (Consolidated & Deduplicated) */
/* Responsive Styles (Mobile & Desktop Only) */
@media (max-width: 768px) {
    .cooking-layout {
        padding: 0;
        max-width: 100%;
        background: var(--surface);
    }

    .content-grid {
        grid-template-columns: 1fr;
        gap: 16px;
        margin-bottom: 24px;
    }

    .hero {
        padding: 0;
        background: var(--surface);
    }

    .hero-wrap {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 20px 16px;
        max-width: 100%;
    }

    .main-content {
        padding: 0 16px;
        max-width: 100%;
        background: var(--surface);
    }

    .hero-media {
        aspect-ratio: 16 / 9;
        height: auto;
    }

    .hero-info {
        gap: 8px;
    }

    .title {
        font-size: clamp(24px, 6vw, 32px);
        margin-bottom: 10px;
    }

    .hero-tagline {
        font-size: 14px;
        letter-spacing: 0.2px;
    }

    .shop-cta {
        font-size: 16px;
        padding: 16px 24px;
        margin-top: 24px;
        font-weight: 600;
    }

    .card {
        padding: 16px;
        min-height: 200px;
        border-radius: var(--radius);
        border: 1px solid var(--border-light);
        margin-bottom: 16px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    }

    .steps-container {
        margin-bottom: 24px;
        border-radius: var(--radius);
        border: 1px solid var(--border-light);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    }

    .shop {
        margin-bottom: 24px;
        padding: 20px 16px;
        background: var(--surface);
        border: 1px solid var(--primary);
        border-radius: var(--radius);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    }

    .steps-scroll-container {
        margin: 0;
        padding: 0;
    }

    .steps-row {
        padding: 20px 0;
    }

    .steps-slider {
        padding: 0 8px;
        gap: 12px;
    }

    .step-card {
        flex: 0 0 80%;
        min-width: 80%;
        padding: 10px;
    }

    .row-nav-btn {
        display: none !important;
    }

    .product {
        flex: 0 0 240px;
        min-width: 150px;
        min-height: auto;
    }

    .product-info {
        display: flex;
        flex-direction: column;
        padding-bottom: 8px;
    }

    .vendor-options {
        display: flex;
        flex-direction: column;
        gap: 6px;
        margin-bottom: 8px;
        /* Gap before button */
    }

    .product-actions {
        margin-left: 8px;
        margin-right: 8px;
        margin-bottom: 8px;
        margin-top: 16px;
    }

    .product-image {
        height: 160px;
    }

    .suggested-prompts {
        gap: 6px;
    }

    .suggested-prompt {
        font-size: 22px;
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: 14px;
        padding: 12px 16px;
        min-height: 44px;
    }

    .prompt-arrow {
        display: none;
    }

    .suggested-tab {
        padding: 6px 12px;
        font-size: 14px;
        min-height: 22px;
        min-width: 44px;
    }

    .detail-popup-overlay {
        padding: var(--mobile-overlay-gap);
        align-items: stretch;
    }

    .detail-popup-container {
        width: 100%;
        max-width: 100%;
        max-height: calc(100vh);
        margin: 0;
        border-radius: clamp(16px, 6vw, 24px);
        display: flex;
        flex-direction: column;
    }

    .detail-popup-content {
        flex: 1 1 auto;
        min-height: 0;
        padding: clamp(18px, 5vw, 28px);
        max-height: none;
    }

    .detail-product {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 16px;
    }

    .dp-section {
        padding: 12px;
        margin-bottom: 16px;
    }

    .kv {
        gap: 8px;
        border-right: none;
    }

    .k {
        font-size: 12px;
        margin-bottom: 2px;
    }

    .dp-section-title {
        font-size: 14px;
    }

    .dp-actions {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .prompt-text {
        font-size: 14px;
        color: #3A3A3C;
    }

    .header {
        padding: 10px;
        position: relative;
    }

    .header h1 {
        font-size: 2rem;
    }

    .header p {
        font-size: 0.9rem;
    }

    .header-buttons {
        gap: 8px;
        margin-bottom: 12px;
        min-height: 36px;
        margin-bottom: 0px;
    }

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

    .search-form {
        padding: 6px;
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    }

    .search-input {
        font-size: 16px;
        padding-right: 48px;
    }

    .search-input::placeholder {
        font-size: 16px;
    }

    .clear-search {
        right: 16px;
        top: 12px;
        transform: none;
    }

    .clear-search svg {
        width: 14px;
        height: 14px;
    }

    .sticky-header {
        padding: 10px 10px;
    }

    .search-button {
        padding: 10px 12px;
        font-size: 16px;
        min-width: 45px;
    }

    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .product-card {
        width: 100%;
        min-width: 0;
        margin-right: 0;
    }

    .product-title {
        font-size: 0.85rem;
        height: 4.5rem;
    }

    .product h4 {
        font-size: 17px;
        height: auto;
        min-height: auto;
    }

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

    .product-brand {
        height: 16px;
        line-height: 10px;
        font-size: 0.6rem;
    }

    .product-price-section {
        height: 26px;
    }

    .product-details {
        height: 50px;
    }

    .product-category {
        height: 12px;
        line-height: 12px;
        font-size: 0.7rem;
    }

    .product-maker {
        white-space: normal;
        overflow-wrap: anywhere;
        height: auto;
        line-height: 16px;
        /* slightly taller for readability */
        max-height: 28px;
        /* up to 2 lines */
    }

    .product-content {
        height: auto !important;
    }

    .buy-it-card-btn {
        position: relative !important;
        /* Ensure button stays within card */
        bottom: auto !important;
        left: auto !important;
        right: auto !important;
    }

    .multi-product-container {
        padding: 0 10px;
    }

    .product-row {
        margin-bottom: 0px;
    }

    .row-products {
        gap: 12px;
    }

    .row-header {
        flex-direction: row;
        gap: 6px;
        text-align: center;
        padding: 12px 15px;
    }

    .row-title {
        font-size: 1rem;
        text-align: left;
    }

    .row-category {
        font-size: 0.75rem;
        padding: 3px 6px;
    }

    .row-container {
        padding: 10px 0;
    }

    .modal-content {
        width: 95%;
        height: 90%;
        margin: 5% auto;
    }

    .modal-header {
        padding: 12px 15px;
    }

    .modal-header h2 {
        font-size: 1rem;
    }

    .modal-close {
        width: 25px;
        height: 25px;
        font-size: 1.5rem;
    }

    .cart-modal-content {
        width: 95%;
        max-height: 90vh;
        margin: 5% auto;
    }

    .cart-modal-header {
        padding: 15px 20px;
    }

    .cart-modal-header h2 {
        font-size: 18px;
    }

    .cart-section {
        padding: 20px;
    }

    .cart-item {
        display: flex;
        flex-direction: row;
        gap: 12px;
        padding: 15px;
        background: white;
        border-radius: 12px;
        border: 1px solid #e9ecef;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
        margin-bottom: 0px;
        align-items: flex-start;
    }

    .cart-item-image {
        width: 80px;
        height: 80px;
        border-radius: 8px;
        overflow: hidden;
        background: #f8f9fa;
        flex-shrink: 0;
    }

    .cart-item-content {
        flex: 1;
        display: flex;
        flex-direction: row;
        gap: 8px;
        min-width: 0;
    }

    .cart-item-info,
    .vendor-details {
        display: flex;
        flex-direction: column;
        gap: 4px;
        flex: 1;
        min-width: 0;
    }

    .cart-item-title {
        font-weight: 600;
        color: var(--text);
        font-size: 16px;
        line-height: 1.3;
        margin: 0;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .cart-item-mall {
        color: var(--text-muted);
        font-size: 16px;
        margin: 0;
    }

    .cart-item-price {
        font-weight: 700;
        color: #e74c3c;
        font-size: 16px;
        margin: 4px 0 0 0;
    }

    .cart-item-controls {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 8px;
        justify-content: flex-start;
        margin-top: 8px;
        flex-shrink: 0;
        width: 60px;
        min-width: 60px;
    }

    .cart-item-actions,
    .cart-item-quantity {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
    }

    .cart-item-actions {
        flex-shrink: 0;
    }

    .quantity-input {
        width: 50px;
        height: 32px;
        padding: 4px 6px;
        border: 1px solid #e9ecef;
        border-radius: 6px;
        text-align: center;
        font-size: 16px;
        font-weight: 600;
        background: white;
    }

    .cart-delete-btn {
        padding: 6px;
        width: 32px;
        height: 32px;
    }

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

    .customer-form {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .form-label {
        font-size: 16px;
        min-width: 70px;
        font-weight: 500;
        margin-bottom: 5px;
    }

    .form-textarea {
        min-height: 60px;
        font-size: 16px;
        width: 100%;
        box-sizing: border-box;
        flex: 1;
    }

    .cart-total {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 16px 20px;
        background: var(--gradient-l);
        border-radius: 8px;
        margin: 16px 0;
        border: 1px solid #e9ecef;
    }

    .cart-total-label,
    .cart-total-amount {
        font-size: 16px;
    }

    .suggested-header p {
        font-size: 16px;
    }

    .suggested-tabs-container {
        margin-bottom: 15px;
    }

    .suggested-tabs {
        justify-content: flex-start;
        gap: 6px;
        padding: 0;
    }

    .language-option {
        font-size: 16px;
    }

    .prompt-icon {
        display: none;
    }

    .cart-actions {
        display: flex;
        gap: 12px;
        justify-content: space-between;
        margin-top: 20px;
        padding: 20px;
        border-top: 1px solid var(--border);
        background: #f8f9fa;
    }

    .btn-cart {
        flex: 1;
        padding: 14px 20px;
        font-size: 16px;
        border-radius: 6px;
        justify-content: center;
        min-height: 48px;
        font-weight: 600;
    }

    .btn-cart-primary {
        background: var(--gradient-l);
        color: #4B0082;
        border: 1px solid #D8BFD8;
    }

    .btn-cart-secondary {
        background: white;
        color: var(--text);
        border: 2px solid #e9ecef;
    }

    .notification {
        top: 60px;
        right: 10px;
        left: 10px;
        max-width: none;
        font-size: 16px;
    }

    .clarification-container,
    .clarification-form {
        max-width: 348px;
    }

    .clarification-form {
        margin: 10px;
        padding: 20px;
    }

    .clarification-header h3 {
        font-size: 1.3em;
    }

    .clarification-actions {
        flex-direction: row;
        gap: 12px;
    }

    .clarify-submit {
        flex: 1;
        text-align: center;
    }

    .clarify-option {
        min-width: 100px;
        padding: 10px 16px;
        font-size: 14px;
    }

    .segmented-control {
        flex-direction: row;
        flex-wrap: wrap;
        width: 100%;
    }

    .segmented-option {
        flex: 0 0 50%;
        max-width: 50%;
        min-height: 44px;
        padding: 10px 16px;
        font-size: 14px;
    }

    .search-container {
        gap: 5px;
        max-width: calc(100% - 10px);
    }

    .container {
        width: 100%;
        max-width: 100%;
        margin: 0;
        min-height: 100vh;
    }

    .language-button,
    .cart-button {
        padding: 7px 10px;
        font-size: 12px;
    }

    .flag svg {
        width: 22px;
        height: 22px;
    }

    .search-button.ai-progress {
        height: auto;
        padding: 5px 10px;
        font-size: 12px;
        min-width: auto;
        border-radius: 12px;
    }

    .search-section {
        padding: 40px 10px 60px;
    }

    .suggested-header {
        display: none;
    }

    .suggested-searches {
        padding: 16px 16px;
    }

    .ai-button {
        font-size: 14px;
        width: 44px;
        min-width: 44px;
        height: 44px;
        flex-shrink: 0;
    }

    .ai-button svg {
        width: 20px;
        height: 20px;
        flex-shrink: 0;
    }

    .vendor-badges-container {
        margin: 10px 0;
        padding: 0 4px;
    }

    .form-input {
        padding: 10px 12px;
        font-size: 16px;
        width: 100%;
        box-sizing: border-box;
        flex: 1;
    }

    .cart-section-title {
        font-size: 1.3rem;
    }

    .search-input-container {
        padding: 2px;
    }

    .search-controls-row {
        padding: 0 8px 0 4px;
    }

    .search-active-badge {
        font-size: 12px;
        padding: 5px 10px;
    }
}

@media (min-width: 769px) {
    .detail-product {
        grid-template-columns: 1fr;
    }

    .dp-media {
        position: relative;
        top: 0;
    }

    .dp-actions {
        margin-top: 16px;
    }

    .dp-specs--two-column {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .cart-item {
        display: grid;
        grid-template-columns: 100px 1fr auto auto auto;
        gap: 20px;
        align-items: center;
        padding: 15px;
        background: white;
        border-radius: var(--radius-sm);
        border: 1px solid var(--border);
        margin-bottom: 0px;
    }

    .cart-item-image {
        width: 100px;
        height: 100px;
        border-radius: 8px;
        overflow: hidden;
        background: #f8f9fa;
    }

    .cart-item-content {
        display: contents;
    }

    .cart-item-info {
        display: flex;
        flex-direction: column;
        gap: 5px;
    }

    .cart-item-title {
        font-size: 0.95rem;
        font-weight: 600;
        color: var(--text);
        margin: 0;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .cart-item-mall {
        font-size: 0.85rem;
        color: var(--text-muted);
        margin: 0;
    }

    .cart-item-price {
        font-size: 1.1rem;
        font-weight: 700;
        color: #e74c3c;
        margin: 0;
    }

    .cart-item-controls {
        display: contents;
    }

    .cart-item-actions,
    .cart-item-quantity {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .quantity-input {
        width: 60px;
        height: auto;
        padding: 8px;
        font-size: 0.9rem;
        border: 1px solid #e9ecef;
        border-radius: 6px;
        text-align: center;
        font-weight: 600;
        background: white;
    }

    .cart-delete-btn {
        padding: 8px;
    }

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

    .suggested-searches {
        padding: 20px 40px;
    }

    .suggested-tabs {
        gap: 10px;
        justify-content: center;
    }

    .container {
        width: 100%;
        max-width: 100%;
        margin: 0;
        min-height: 100vh;
    }

    .header {
        padding: 16px 24px;
    }

    .search-section {
        padding: 48px 24px 80px;
    }

    .suggested-header {
        display: none;
    }

    .suggested-tab {
        padding: 8px 16px;
        font-size: 14px;
    }

    .search-input {
        font-size: 19px;
        padding: 14px 18px;
        padding-right: 52px;
    }

    .search-controls-row {
        padding-left: 4px;
    }

    .search-button {
        height: 34px;
        padding: 6px 16px;
        font-size: 14px;
        min-width: 60px;
        border-radius: 17px;
    }

    .search-button.ai-progress {
        height: 34px;
        padding: 7px 14px;
        font-size: 14px;
        min-width: auto;
        border-radius: 14px;
    }

    .search-active-badge {
        padding: 7px 14px;
        font-size: 14px;
        border-radius: 14px;
        height: 34px;
        display: flex;
        align-items: center;
    }

    .clear-search {
        top: 16px;
        transform: none;
    }

    .suggested-prompts {
        gap: 8px;
    }

    .suggested-prompt {
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: 14px;
        padding: 16px 20px;
    }

    .detail-product .dp-image .detail-popup-close {
        top: 18px;
        right: 18px;
    }
}

/* ============================= Comparison Layout Styles ============================= */
.comparison-container {
    width: 100%;
    padding: 0;
}

.comparison-group {
    background: var(--surface);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    margin-bottom: 40px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.comparison-group .group-header {
    padding: 20px;
    background: #f9f9f9;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
}

.comparison-group .group-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    flex: 1;
}

.comparison-group .group-meta {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Price Leaderboard */
.price-leaderboard {
    padding: 14px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid var(--border-light);
}

.leaderboard-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.leaderboard-bars {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.leaderboard-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 0;
}

.leaderboard-bar.lb-best {
    background: linear-gradient(90deg, rgba(34, 197, 94, 0.08) 0%, transparent 100%);
    margin: 0 -20px;
    padding: 8px 20px;
    border-radius: 0;
}

.lb-vendor-info {
    width: 100px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.lb-vendor-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lb-best .lb-vendor-name {
    font-weight: 600;
    color: #16a34a;
}

.lb-price-info {
    width: 100px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.lb-price {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.lb-best .lb-price {
    color: #16a34a;
}

.lb-best-tag {
    font-size: 10px;
    font-weight: 600;
    color: #22c55e;
    background: rgba(34, 197, 94, 0.1);
    padding: 2px 8px;
    border-radius: 3px;
    white-space: nowrap;
}

.lb-bar-container {
    flex: 1;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    position: relative;
    min-width: 60px;
    display: flex;
    align-items: center;
}

.lb-bar-fill {
    height: 100%;
    background: #94a3b8;
    border-radius: 4px;
    transition: width 0.5s ease-out;
}

.lb-diff-text {
    margin-left: 8px;
    font-size: 11px;
    font-weight: 500;
    color: #64748b;
    white-space: nowrap;
}

/* Scrollable Table Container */
.table-scroll-container {
    width: 100%;
    overflow-x: auto;
    position: relative;
    background: linear-gradient(to right, white 30%, rgba(255, 255, 255, 0)), linear-gradient(to right, rgba(255, 255, 255, 0), white 70%) 0 100%, radial-gradient(farthest-side at 0 50%, rgba(0, 0, 0, .15), rgba(0, 0, 0, 0)), radial-gradient(farthest-side at 100% 50%, rgba(0, 0, 0, .15), rgba(0, 0, 0, 0)) 0 100%;
    background-repeat: no-repeat;
    background-color: white;
    background-size: 40px 100%, 40px 100%, 14px 100%, 14px 100%;
    background-position: 0 0, 100% 0, 0 0, 100% 0;
    background-attachment: local, local, scroll, scroll;
}

/* Matrix Table */
.matrix-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    min-width: 800px;
}

.matrix-table th {
    text-align: left;
    padding: 14px 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
    background: white;
    white-space: nowrap;
    vertical-align: middle;
}

.matrix-table th.text-center {
    text-align: center;
}

.matrix-table td {
    padding: 14px 12px;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
    background: white;
    color: var(--text-secondary, #666);
}

.matrix-table td:nth-child(2) {
    text-align: left;
}

.matrix-table td:nth-child(3) {
    text-align: left;
}

.matrix-table tr.expanded td {
    border-bottom: none;
    background: #f8f9fa;
}

.matrix-table tr:last-child td {
    border-bottom: none;
}

/* Column widths */
.col-expand {
    width: 24px;
    text-align: center;
}

.col-product {
    min-width: 280px;
    width: 20%;
}

.col-variant {
    width: 80px;
}

.col-size {
    width: 80px;
    text-align: center;
}

.col-size-val {
    font-size: 13px;
}

.col-qty {
    width: 70px;
    min-width: 70px;
    max-width: 70px;
    text-align: center;
}

.matrix-table th.col-qty {
    white-space: normal;
    word-break: keep-all;
    line-height: 1.3;
    padding: 10px 8px;
}

.matrix-table td.col-qty {
    padding: 14px 8px;
}

.col-vendor {
    width: 130px;
}

/* Text alignment utility */
.text-center {
    text-align: center;
}

/* Product Cell */
.prod-cell {
    display: flex;
    gap: 12px;
    align-items: center;
}

.prod-thumb {
    width: 64px;
    height: 64px;
    object-fit: contain;
    border-radius: 8px;
    border: 1px solid #eee;
    background: white;
    flex-shrink: 0;
}

.prod-thumb-placeholder {
    width: 64px;
    height: 64px;
    border-radius: 8px;
    background: var(--background);
    border: 1px dashed var(--border);
    flex-shrink: 0;
}

.prod-name {
    font-weight: 600;
    color: var(--text);
    font-size: 14px;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    position: relative;
}

@media (min-width: 769px) {
    .prod-cell {
        position: relative;
    }

    .prod-name:hover::after {
        content: attr(data-full-name);
        position: absolute;
        left: 0;
        top: 100%;
        margin-top: 4px;
        background: var(--text);
        color: var(--surface);
        padding: 8px 12px;
        border-radius: 6px;
        font-size: 13px;
        font-weight: 400;
        white-space: normal;
        word-wrap: break-word;
        max-width: 300px;
        z-index: 1000;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
        pointer-events: none;
    }
}

/* Expand Button */
.btn-expand {
    background: none;
    border: none;
    cursor: pointer;
    color: #8e8e93;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
    font-size: 12px;
}

.btn-expand:hover {
    background: #eee;
    color: var(--text);
}

.btn-expand.open {
    transform: rotate(180deg);
    color: var(--primary);
}

/* Detail Row */
.detail-row {
    display: none;
    background: #f8f9fa;
}

.detail-row.open {
    display: table-row;
}

.detail-content {
    padding: 20px 20px 20px 80px;
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    font-size: 13px;
}

.detail-col {
    flex: 1;
    min-width: 150px;
}

.detail-col-image {
    flex: 0 0 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.detail-col-info {
    flex: 1 1 180px;
}

.detail-col-features {
    flex: 2 1 250px;
}

.detail-col-delivery,
.detail-col-promo {
    flex: 1 1 200px;
}

.detail-features-list {
    list-style: disc;
    padding-left: 18px;
    margin: 0;
}

.detail-features-list li {
    margin-bottom: 6px;
    color: var(--text);
}

.detail-delivery-text,
.detail-promo-text {
    margin: 0;
    color: var(--text);
    line-height: 1.5;
}

.detail-promo-text {
    color: #e65100;
    font-weight: 500;
}

.detail-col h4 {
    margin: 0 0 12px;
    font-size: 12px;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
    font-weight: 600;
}

/* Variant Tags */
.variant-tag {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    background: #f0f0f5;
    color: var(--text-secondary);
    margin: 2px;
    white-space: nowrap;
}

.tag-flavor {
    background: #fff0f5;
    color: #d63384;
}

.tag-sugar {
    background: #e0f7fa;
    color: #00838f;
}

.tag-calcium {
    background: #e8f5e9;
    color: #2e7d32;
}

/* Quantity Badge */
.qty-badge {
    background: #e9ecef;
    color: #495057;
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 13px;
}

/* Vendor Header */
.vendor-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.col-vendor {
    text-align: center;
}

.col-vendor .empty-cell {
    text-align: center;
    color: #ccc;
}

.vendor-logo-sm {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    object-fit: contain;
    flex-shrink: 0;
}

/* Price Cell */
.price-cell {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.price-main {
    font-weight: 700;
    font-size: 14px;
    color: var(--text);
}

.price-unit {
    font-size: 11px;
    color: var(--text-secondary);
}

.best-price .price-main {
    color: var(--success);
}

/* Price cell with actions */
.price-cell-row {
    display: flex;
    align-items: center;
    justify-content: center;
}

.price-cell-main {
    min-width: 80px;
    text-align: left;
}

.price-cell-main a {
    color: inherit;
    text-decoration: none;
}

.price-cell-main a:hover {
    text-decoration: underline;
}

.price-actions {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex-shrink: 0;
    margin-left: 20px;
}

.price-action-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: 4px;
    width: 22px;
    height: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 0.15s ease;
    color: var(--text-secondary);
}

.price-action-btn:hover {
    background: var(--background);
    border-color: var(--primary);
    color: var(--primary);
}

.price-action-btn svg {
    width: 12px;
    height: 12px;
}

.empty-cell {
    color: #ccc;
    font-size: 14px;
    text-align: left;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   WAITING UI - Loading animation during AI search
   ═══════════════════════════════════════════════════════════════════════════════ */

.waiting-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    gap: 32px;
    animation: waitingFadeIn 0.4s ease-out;
    min-height: 300px;
}

.waiting-container.waiting-fade-out {
    animation: waitingFadeOut 0.3s ease-out forwards;
}

@keyframes waitingFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes waitingFadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }

    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

/* Robot Section */
.waiting-robot-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.waiting-robot-section.waiting-compact {
    gap: 16px;
}

.waiting-robot-section.waiting-compact .waiting-robot {
    width: 80px;
    height: 80px;
}

.waiting-robot {
    width: 120px;
    height: 140px;
    animation: robotFloat 3s ease-in-out infinite;
}

.waiting-robot-svg {
    width: 100%;
    height: 100%;
}

/* Robot animations */
@keyframes robotFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.robot-eye {
    animation: robotBlink 4s ease-in-out infinite;
}

@keyframes robotBlink {

    0%,
    45%,
    55%,
    100% {
        transform: scaleY(1);
    }

    50% {
        transform: scaleY(0.1);
    }
}

.robot-magnifier {
    animation: robotSearch 2s ease-in-out infinite;
    transform-origin: 105px 60px;
}

@keyframes robotSearch {

    0%,
    100% {
        transform: rotate(-5deg);
    }

    50% {
        transform: rotate(5deg);
    }
}

.robot-arm-left {
    animation: robotArmWaveLeft 1.5s ease-in-out infinite;
    transform-origin: 28px 86px;
}

.robot-arm-right {
    animation: robotArmWaveRight 1.5s ease-in-out infinite 0.2s;
    transform-origin: 92px 86px;
}

@keyframes robotArmWaveLeft {

    0%,
    100% {
        transform: rotate(0deg);
    }

    50% {
        transform: rotate(-8deg);
    }
}

@keyframes robotArmWaveRight {

    0%,
    100% {
        transform: rotate(0deg);
    }

    50% {
        transform: rotate(8deg);
    }
}

/* Text Section */
.waiting-text {
    display: block;
    font-size: 14px;
    font-weight: 400;
    color: var(--text-secondary);
    text-align: center;
    max-width: 500px;
    line-height: 1.5;
}

.waiting-text-content {
    animation: waitingPulse 2s ease-in-out infinite;
}

@keyframes waitingPulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

/* Dots stay inline at end of text */
.waiting-dots {
    display: inline;
    white-space: nowrap;
}

.waiting-dots span {
    display: inline-block;
    animation: dotBounce 1.4s ease-in-out infinite;
}

.waiting-dots span:nth-child(1) {
    animation-delay: 0s;
}

.waiting-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.waiting-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes dotBounce {

    0%,
    80%,
    100% {
        opacity: 0.3;
        transform: translateY(0);
    }

    40% {
        opacity: 1;
        transform: translateY(-5px);
    }
}

/* Intro Centered Text */
.waiting-intro-text {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 400;
    text-align: center;
    margin-bottom: 24px;
    width: 100%;
}

/* Robot Scene Wrapper */
.waiting-scene {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 200px;
    /* Estimated robot width area */
    margin: 0 auto;
}

.waiting-robot {
    position: relative;
    z-index: 10;
    /* Robot on top */
}

/* Products Stream - Left side, Behind Robot */
.waiting-products-stream-wrapper {
    position: absolute;
    top: 50%;
    /* Aligned with robot body center */
    transform: translateY(-50%);
    margin-top: 12px;
    right: 58%;
    /* Start aligned with body left side */
    width: 420px;
    height: 128px;
    overflow: hidden;
    z-index: 1;
    /* Behind robot */
    /* Fade out near robot body (right edge) */
    mask-image: linear-gradient(to right, black 0%, black 58%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, black 0%, black 58%, transparent 100%);
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.waiting-products-stream {
    display: flex;
    gap: 16px;
    animation: productStreamScroll 14s linear infinite;
}

@keyframes productStreamScroll {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-33.33%);
    }

    /* Move Left */
}

.waiting-product-thumb {
    flex-shrink: 0;
    width: 120px;
    height: 120px;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

/* Badges Stream - Behind Robot */
.waiting-badges-stream-wrapper {
    position: absolute;
    top: 45px;
    /* Aligned with magnifier height */
    left: 58%;
    /* Start aligned with magnifier right side */
    width: 300px;
    /* Length of stream extending to the right */
    height: 40px;
    overflow: hidden;
    z-index: 1;
    /* Behind robot */
    /* Mask right edge so badges appear from "outside" smoothly */
    mask-image: linear-gradient(to right, black 20%, black 80%, transparent);
    -webkit-mask-image: linear-gradient(to right, black 20%, black 80%, transparent);
    display: flex;
    align-items: center;
}

.waiting-badges-stream {
    display: flex;
    gap: 10px;
    animation: badgeStreamScroll 10s linear infinite;
}

@keyframes badgeStreamScroll {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-33.33%);
    }

    /* Move 1/3 since we have 3 sets */
}

.waiting-query-badge {
    display: inline-block;
    padding: 6px 14px;
    background: linear-gradient(135deg, rgba(192, 132, 252, 0.15), rgba(99, 102, 241, 0.15));
    color: #6366F1;
    border: 1px solid rgba(99, 102, 241, 0.25);
    font-size: 13px;
    font-weight: 500;
    border-radius: 20px;
    white-space: nowrap;
    opacity: 0.9;
    animation: badgePopIn 0.4s ease-out backwards;
}

.waiting-query-badge:nth-child(1) {
    animation-delay: 0s;
}

.waiting-query-badge:nth-child(2) {
    animation-delay: 0.15s;
}

.waiting-query-badge:nth-child(3) {
    animation-delay: 0.3s;
}

.waiting-query-badge:nth-child(4) {
    animation-delay: 0.45s;
}

@keyframes badgePopIn {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(10px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Carousel Section */
.waiting-carousel-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    width: 100%;
    max-width: 600px;
    animation: waitingFadeIn 0.5s ease-out 0.2s both;
}

.waiting-carousel-text {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

.waiting-carousel {
    width: 100%;
    height: 180px;
    position: relative;
    overflow: hidden;
    border-radius: var(--radius);
    background: var(--background);
    border: 1px solid var(--border-light);
}

.waiting-slides {
    display: flex;
    width: 100%;
    height: 100%;
    position: relative;
}

.waiting-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.6s ease, transform 0.6s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.waiting-slide.active {
    opacity: 1;
    transform: scale(1);
    z-index: 2;
}

.waiting-slide.prev {
    opacity: 0;
    transform: scale(1.05);
    z-index: 1;
}

.waiting-slide img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: var(--radius-sm);
}

/* Mobile responsive */
@media (max-width: 768px) {
    .waiting-container {
        padding: 32px 16px;
        gap: 24px;
        min-height: 250px;
    }

    .waiting-robot {
        width: 100px;
        height: 116px;
    }

    .waiting-robot-section.waiting-compact .waiting-robot {
        width: 70px;
        height: 82px;
    }

    .waiting-text {
        font-size: 16px;
        max-width: 300px;
    }

    .waiting-carousel {
        height: 140px;
    }

    .waiting-products-stream-wrapper {
        top: 50%;
        margin-top: 8px;
        width: 320px;
        height: 104px;
    }

    .waiting-products-stream {
        gap: 12px;
    }

    .waiting-product-thumb {
        width: 92px;
        height: 92px;
        border-radius: 10px;
    }
}
