:root {
    --primary: #FF5A00;
    --primary-light: #FFF0E6;
    --surface: #FFFFFF;
    --background: #F4F5F7;
    --text: #191F28;
    --text-muted: #8B95A1;
    --border: #F2F4F6;
    
    --iga-text: #B47D00;
    --iga-bg: #FFF8E6;
    --coles-text: #E31837;
    --coles-bg: #FDEDF0;
    --woolies-text: #178841;
    --woolies-bg: #E8F5EB;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Pretendard Variable', 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, 'Helvetica Neue', 'Segoe UI', 'Apple SD Gothic Neo', 'Noto Sans KR', 'Malgun Gothic', sans-serif;
    background-color: var(--background);
    color: var(--text);
    min-height: 100vh;
}

/* Top Marquee Scrolling Ticker - Premium Infinite Loop */
.top-marquee {
    background: linear-gradient(90deg, #FF5A00 0%, #FF7A00 100%);
    color: #FFFFFF;
    font-size: 13px;
    font-weight: 700;
    padding: 11px 0;
    overflow: hidden;
    white-space: nowrap;
    position: relative;
    box-shadow: 0 2px 8px rgba(255, 90, 0, 0.2);
}

.marquee-track {
    display: flex;
    width: max-content;
    animation: scrollMarquee 35s linear infinite;
}

.marquee-content {
    display: flex;
    align-items: center;
    gap: 30px;
    padding-right: 30px;
}

.marquee-separator {
    color: rgba(255, 255, 255, 0.6);
    font-weight: 800;
    font-size: 16px;
}

@keyframes scrollMarquee {
    0% {
        transform: translate3d(0, 0, 0);
    }
    100% {
        transform: translate3d(-50%, 0, 0);
    }
}

.app-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 40px;
    padding-top: 10px;
}

.header h1 {
    font-size: 34px;
    font-weight: 900;
    letter-spacing: -1.5px;
    margin-bottom: 10px;
    color: #191F28;
    background: linear-gradient(135deg, #191F28 0%, #FF5A00 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header p {
    color: #4E5968;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.3px;
}

/* Tabs */
.tabs {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-bottom: 40px;
    flex-wrap: wrap;
    background: #F2F4F6;
    padding: 6px;
    border-radius: 100px;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

.tab {
    background: transparent;
    border: none;
    padding: 10px 24px;
    border-radius: 100px;
    font-weight: 700;
    font-size: 14px;
    color: #4E5968;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.tab:hover {
    color: #191F28;
}

.tab.active {
    background: #FFFFFF;
    color: var(--primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Loading */
.loading-state {
    text-align: center;
    padding: 60px 0;
}

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

.loading-state p {
    color: var(--text-muted);
    font-weight: 500;
}

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

/* Card */
.product-card {
    background: var(--surface);
    border-radius: 24px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.04);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(0,0,0,0.02);
}

.product-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px rgba(255, 90, 0, 0.08);
    border-color: rgba(255, 90, 0, 0.15);
}

/* Card Hero (Image Section) - Warm Premium Canvas */
.card-hero {
    background: linear-gradient(135deg, #FFFDFB 0%, #FFF5EF 100%);
    padding: 40px 20px;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    border-bottom: 1px solid rgba(255, 90, 0, 0.06);
    overflow: hidden;
}

.card-badges {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    display: flex;
    justify-content: space-between;
}

.badge-kg {
    background: var(--text);
    color: white;
    padding: 6px 14px;
    border-radius: 100px;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.3px;
}

.badge-lowest {
    background: var(--primary-light);
    color: var(--primary);
    padding: 6px 14px;
    border-radius: 100px;
    font-weight: 700;
    font-size: 13px;
}

.badge-type {
    padding: 6px 14px;
    border-radius: 100px;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.3px;
}

.badge-type.medium_grain {
    background: #E8F5E9;
    color: #2E7D32;
}

.badge-type.calrose {
    background: #FFF3E0;
    color: #E65100;
}

.badge-type.jasmine {
    background: #E1F5FE;
    color: #0277BD;
}

.product-image {
    height: 180px;
    max-width: 100%;
    object-fit: contain;
    mix-blend-mode: multiply;
    transition: transform 0.4s ease;
}

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

/* Card Body */
.card-body {
    padding: 24px;
}

.product-name {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 24px;
    color: var(--text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Winner Section */
.winner-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 22px;
}

.winner-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.winner-label {
    font-size: 12px;
    font-weight: 600;
    color: #8B95A1;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.winner-badge-pill {
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 100px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.winner-badge-pill.iga { color: var(--iga-text); background: var(--iga-bg); }
.winner-badge-pill.coles { color: var(--coles-text); background: var(--coles-bg); }
.winner-badge-pill.woolies { color: var(--woolies-text); background: var(--woolies-bg); }
.winner-badge-pill.joint { color: #FF5A00; background: #FFF0EB; }

.winner-price-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.winner-price {
    font-size: 32px;
    font-weight: 850;
    color: #191F28;
    letter-spacing: -1px;
    line-height: 1;
}

.winner-unit-price {
    font-size: 14px;
    font-weight: 600;
    color: #FF5A00;
}

.divider {
    height: 1px;
    background: var(--border);
    margin: 0 0 16px 0;
}

/* Comparison List */
.comparison-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.comp-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    border-radius: 12px;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.comp-row.highlight {
    background: #FFF9F5;
    border: 1px dashed rgba(255, 90, 0, 0.25);
}

.comp-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.comp-store {
    font-size: 13px;
    font-weight: 600;
    color: #4E5968;
    width: 90px;
}

.comp-row.highlight .comp-store {
    color: #191F28;
    font-weight: 800;
}

.comp-price {
    font-size: 16px;
    font-weight: 700;
    color: #191F28;
    text-align: right;
}

.comp-row.highlight .comp-price {
    color: var(--primary);
    font-weight: 800;
}

.comp-btn {
    background: #F2F4F6;
    color: #4E5968;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s ease;
}

.comp-row.highlight .comp-btn {
    background: var(--primary);
    color: white;
}

.comp-btn:hover {
    filter: brightness(0.95);
    transform: translateY(-1px);
}

/* Animations */
@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.2; }
}

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

@media (max-width: 640px) {
    .app-container { padding: 24px 16px; }
    .header h1 { font-size: 26px; }
    .product-image { height: 160px; }
    .grid { gap: 16px; }
}

/* Kakao Channel Section */
/* Generic Info Box Section */
.info-box-wrap {
    margin-top: 60px;
    padding: 40px 20px;
    background: var(--surface);
    border-radius: 24px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.03);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.info-box-title {
    font-size: 20px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.info-box-desc {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.info-box-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    align-items: center;
}

.info-box-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    height: 40px;
    padding: 0 18px;
    border-radius: 12px;
    text-decoration: none;
    background-color: #FEE500 !important;
    color: #191F28 !important;
    transition: transform 0.2s ease, filter 0.2s ease;
}

.info-box-btn:hover {
    transform: scale(1.03);
    filter: brightness(0.95);
}

.info-icon-1, .info-icon-2 {
    display: inline-block;
    width: 16px;
    height: 16px;
    background-color: transparent;
    margin-right: 8px;
    flex-shrink: 0;
}

.info-icon-1 {
    background: url('data:image/svg+xml;utf8,<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 3c-5.52 0-10 3.81-10 8.5 0 2.76 1.5 5.21 3.82 6.75-.38 1.43-1.39 3.32-1.48 3.52-.1.22.1.43.33.32 1.47-.73 4.14-2.14 5.37-2.88.63.09 1.28.14 1.96.14 5.52 0 10-3.81 10-8.5S17.52 3 12 3zm1 9h3v2h-3v3h-2v-3H8v-2h3V9h2v3z" fill="%23191F28"/></svg>') no-repeat center / contain;
}

.info-icon-2 {
    background: url('data:image/svg+xml;utf8,<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 3c-5.52 0-10 3.81-10 8.5 0 2.76 1.5 5.21 3.82 6.75-.38 1.43-1.39 3.32-1.48 3.52-.1.22.1.43.33.32 1.47-.73 4.14-2.14 5.37-2.88.63.09 1.28.14 1.96.14 5.52 0 10-3.81 10-8.5S17.52 3 12 3z" fill="%23191F28"/></svg>') no-repeat center / contain;
}

/* Update Status */
.update-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(255, 90, 0, 0.05);
    border: 1px solid rgba(255, 90, 0, 0.12);
    padding: 8px 18px;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 700;
    color: #FF5A00;
    margin-top: 16px;
    box-shadow: 0 4px 12px rgba(255, 90, 0, 0.04);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    position: relative;
}

.status-dot.green {
    background: #00E676;
    box-shadow: 0 0 8px #00E676;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(0, 230, 118, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(0, 230, 118, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(0, 230, 118, 0);
    }
}

/* Live Hero Section - Bright/Light Premium Theme */
.hero-live-container {
    background: linear-gradient(135deg, #FFFFFF 0%, #FFF9F3 100%);
    color: #191F28;
    border-radius: 24px;
    padding: 28px;
    margin-bottom: 40px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(255, 143, 0, 0.08);
    border: 1px solid rgba(255, 143, 0, 0.12);
}

.hero-live-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,143,0,0.06) 0%, transparent 60%);
    pointer-events: none;
}

.hero-live-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 75, 75, 0.08);
    color: #FF4B4B;
    padding: 6px 12px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.8px;
    border: 1px solid rgba(255, 75, 75, 0.15);
    margin-bottom: 20px;
    text-transform: uppercase;
}

.pulse-red-dot {
    width: 6px;
    height: 6px;
    background: #FF4B4B;
    border-radius: 50%;
    box-shadow: 0 0 8px #FF4B4B;
    animation: live-pulse 1.5s infinite;
}

@keyframes live-pulse {
    0% { transform: scale(0.95); opacity: 0.5; }
    50% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(0.95); opacity: 0.5; }
}

.hero-live-body {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 28px;
    position: relative;
    z-index: 1;
}

.hero-live-title {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 6px;
    color: #191F28;
}

.hero-live-subtitle {
    color: #4E5968;
    font-size: 14px;
    margin-bottom: 20px;
    font-weight: 500;
}

/* Best Deal Card */
.hero-deal-card {
    background: #FFFFFF;
    border: 1px solid #E5E8EB;
    border-radius: 16px;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.02);
}

.hero-deal-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(255, 143, 0, 0.08);
    border-color: rgba(255, 143, 0, 0.25);
}

.hero-deal-main {
    display: flex;
    align-items: center;
    gap: 16px;
}

.hero-deal-img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border-radius: 8px;
    background: #FAFAFA;
    padding: 4px;
    border: 1px solid #F2F4F6;
}

.hero-deal-info-col {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0; /* Enables text overflow ellipses on flex child */
}

.hero-deal-store-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.hero-deal-store-badge {
    font-size: 11px;
    font-weight: 800;
    padding: 4px 8px;
    border-radius: 6px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.hero-deal-store-badge.woolies { background: var(--woolies-bg); color: var(--woolies-text); }
.hero-deal-store-badge.coles { background: var(--coles-bg); color: var(--coles-text); }
.hero-deal-store-badge.iga { background: var(--iga-bg); color: var(--iga-text); }

.hero-deal-tag {
    font-size: 11px;
    font-weight: 700;
    color: #FF8F00;
    background: #FFF9F3;
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px dashed rgba(255, 143, 0, 0.3);
}

.hero-deal-name {
    font-size: 15px;
    font-weight: 700;
    color: #191F28;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 260px;
}

.hero-deal-unit {
    font-size: 12px;
    color: #FF8F00;
    font-weight: 700;
}

.hero-deal-price-wrapper {
    display: flex;
    align-items: center;
    gap: 16px;
}

.hero-deal-price-col {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    flex-shrink: 0;
}

.hero-deal-price {
    font-size: 28px;
    font-weight: 800;
    color: #191F28;
    letter-spacing: -1px;
}

.hero-deal-buy-btn {
    background: var(--primary);
    color: white;
    padding: 8px 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 4px 10px rgba(255, 143, 0, 0.2);
}

.hero-deal-buy-btn:hover {
    background: #e68000;
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(255, 143, 0, 0.3);
}

/* Ticker / Right Side */
.hero-live-right {
    border-left: 1px solid #E5E8EB;
    padding-left: 28px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.ticker-title {
    font-size: 12px;
    font-weight: 700;
    color: #6B7280;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.price-ticker {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ticker-row {
    display: flex;
    align-items: center;
    background: #FFFFFF;
    border: 1px solid #E5E8EB;
    padding: 8px 14px;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(0,0,0,0.01);
}

.ticker-rank {
    color: var(--primary);
    font-weight: 800;
    margin-right: 12px;
    width: 10px;
}

.ticker-store-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    margin-right: 8px;
}

.ticker-store-dot.woolies { background: #00E676; }
.ticker-store-dot.coles { background: #FF3D00; }
.ticker-store-dot.iga { background: #FFD600; }

.ticker-store-name {
    color: #4E5968;
    width: 95px;
    white-space: nowrap;
}

.ticker-product-name {
    color: #191F28;
    font-weight: 700;
    width: 45px;
}

.ticker-unit-price {
    color: #FF8F00;
    flex-grow: 1;
    text-align: right;
    padding-right: 12px;
    font-size: 12px;
    font-weight: 700;
}

.ticker-price {
    color: #191F28;
    font-weight: 700;
}

/* Hoju Main Website Link Button - Premium Modern Clean Card */
.hoju-link-container {
    margin-top: 40px;
    width: 100%;
    display: flex;
    justify-content: center;
}

.hoju-main-btn {
    width: 100%;
    max-width: 500px;
    background: #FFF9F3;
    color: var(--primary);
    text-decoration: none;
    padding: 16px 24px;
    border-radius: 16px;
    font-weight: 700;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 16px rgba(255, 143, 0, 0.04);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px dashed rgba(255, 143, 0, 0.25);
}

.hoju-main-btn::after {
    content: '→';
    font-size: 16px;
    font-weight: 800;
    transition: transform 0.2s ease;
}

.hoju-main-btn:hover {
    background: #FFF2E6;
    border-color: rgba(255, 143, 0, 0.4);
    box-shadow: 0 6px 20px rgba(255, 143, 0, 0.08);
    transform: translateY(-1px);
}

.hoju-main-btn:hover::after {
    transform: translateX(4px);
}

.hoju-icon {
    display: none;
}

/* Mobile responsive scrollable tabs and scaling */
@media (max-width: 768px) {
    .hero-live-body {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    .hero-live-right {
        border-left: none;
        padding-left: 0;
        border-top: 1px solid #E5E8EB;
        padding-top: 20px;
    }
    
    .info-box-btns {
        flex-direction: column;
        width: 100%;
        gap: 10px;
    }
    
    .info-box-btn {
        width: 100% !important;
        box-sizing: border-box;
    }
}

@media (max-width: 640px) {
    .app-container {
        padding: 20px 14px;
    }
    
    .header h1 {
        font-size: 26px;
        letter-spacing: -0.5px;
    }
    
    .hero-live-container {
        padding: 20px;
        border-radius: 20px;
    }
    
    .hero-live-title {
        font-size: 18px;
    }
    
    .hero-live-subtitle {
        font-size: 13px;
        margin-bottom: 16px;
    }
    
    .tabs {
        justify-content: flex-start;
        overflow-x: auto;
        flex-wrap: nowrap;
        white-space: nowrap;
        padding: 6px;
        margin-left: 0;
        margin-right: 0;
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
        gap: 6px;
        border-radius: 100px;
        background: #F2F4F6;
        width: 100%;
    }
    
    .tabs::-webkit-scrollbar {
        display: none; /* Hide scrollbars for cleaner mobile view */
    }
    
    .tab {
        padding: 10px 18px;
        font-size: 14px;
        flex-shrink: 0;
        border-radius: 100px;
    }
    
    .grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .product-card {
        border-radius: 20px;
    }
    
    .card-hero {
        padding: 30px 16px;
    }
    
    .product-image {
        height: 150px;
    }
    
    .winner-price {
        font-size: 30px;
    }
}

@media (max-width: 480px) {
    .hero-deal-card {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }
    
    .hero-deal-price-wrapper {
        justify-content: space-between;
    }
}


