@import url('https://fonts.googleapis.com/css2?family=Source+Sans+3:wght@400;600;700;900&display=swap');

:root {
  --green: #008031;
  --green-dark: #006628;
  --gold: #FCBC00;
  --gold-dark: #E0A800;
  --magenta: #E23D96;
  --text: #47494B;
  --text-dark: #1d1d1d;
  --bg: #F5F5F5;
  --white: #FFFFFF;
  --border: #DEDEDE;
  --grey-bar: #F0F0F0;
  --radius-sm: 2px;
  --radius-md: 4px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Source Sans 3', 'Source Sans Pro', sans-serif; font-size: 16px; line-height: 1.5; color: var(--text); background: var(--bg); }
h1, h2, h3, h4 { font-family: 'Source Sans 3', 'Source Sans Pro', sans-serif; color: var(--text-dark); }
a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Top utility bar */
.utility-bar { background: var(--grey-bar); border-bottom: 1px solid var(--border); font-size: 13px; }
.utility-inner { max-width: 1280px; margin: 0 auto; padding: 8px 20px; display: flex; gap: 20px; }
.utility-inner a { color: var(--text); font-weight: 600; }
.utility-inner a:first-child { color: var(--green); }

/* Main header */
.header { background: var(--white); border-bottom: 1px solid var(--border); }
.header-inner { max-width: 1280px; margin: 0 auto; padding: 14px 20px; display: flex; align-items: center; gap: 20px; }
.logo { display: flex; align-items: center; }
.logo img { height: 40px; width: auto; display: block; }
.search-wrap { flex: 1; display: flex; max-width: 640px; }
.search-input { flex: 1; height: 44px; border: 1px solid var(--border); border-right: none; padding: 0 16px; font-size: 15px; font-family: inherit; outline: none; }
.search-btn { width: 56px; height: 44px; background: var(--green); border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.search-btn svg { width: 22px; height: 22px; fill: var(--white); }
.header-actions { display: flex; align-items: center; gap: 16px; margin-left: auto; }
.header-action { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--text); cursor: pointer; }
.header-action svg { width: 18px; height: 18px; fill: var(--text); }
.basket-btn { display: flex; align-items: center; gap: 8px; padding: 10px 16px; background: var(--gold); color: var(--text-dark); font-weight: 700; font-size: 14px; cursor: pointer; }
.basket-btn:hover { background: var(--gold-dark); text-decoration: none; color: var(--text-dark); }
.basket-btn svg { width: 18px; height: 18px; fill: var(--text-dark); }

/* Category nav */
.cat-nav { background: var(--white); border-bottom: 1px solid var(--border); }
.cat-nav-inner { max-width: 1280px; margin: 0 auto; padding: 0 20px; display: flex; gap: 24px; }
.cat-nav-inner a { color: var(--text-dark); font-size: 14px; font-weight: 600; padding: 12px 0; }
.cat-nav-inner a:hover { color: var(--green); text-decoration: none; box-shadow: inset 0 -3px 0 var(--green); }
.cat-nav-inner a.browse { color: var(--green); display: flex; align-items: center; gap: 4px; }

/* Promo bar */
.offers-banner { background: var(--magenta); padding: 10px 20px; text-align: center; font-size: 14px; font-weight: 600; color: var(--white); }
.offers-banner strong { font-weight: 700; }
.offers-banner a { color: var(--white); text-decoration: underline; }

/* Hero */
.hero { background: var(--green); margin: 16px auto; max-width: 1280px; border-radius: 6px; padding: 48px 40px; display: flex; align-items: center; gap: 32px; }
.hero-content { flex: 1; }
.hero h1 { color: var(--white); font-size: 44px; font-weight: 900; line-height: 1.05; margin-bottom: 12px; }
.hero h1 .gold { color: var(--gold); }
.hero p { color: rgba(255,255,255,0.9); font-size: 17px; margin-bottom: 20px; max-width: 480px; }
.hero-cta { display: inline-block; background: var(--white); color: var(--text-dark); padding: 12px 32px; border-radius: 4px; font-weight: 700; font-size: 15px; }
.hero-cta:hover { background: var(--bg); text-decoration: none; color: var(--text-dark); }
.hero-badges { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
.hero-badge { background: rgba(255,255,255,0.15); color: var(--white); padding: 6px 14px; border-radius: 20px; font-size: 13px; font-weight: 600; }

/* Sections */
.section { max-width: 1280px; margin: 0 auto; padding: 24px 20px; }
.section-title { font-size: 24px; font-weight: 700; margin-bottom: 16px; color: var(--text-dark); }

/* Category pills */
.category-pills { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.category-pill { padding: 8px 16px; border-radius: 20px; border: 1px solid var(--border); background: var(--white); font-size: 14px; font-weight: 600; cursor: pointer; transition: all 0.15s; color: var(--text); }
.category-pill.active, .category-pill:hover { background: var(--green); color: var(--white); border-color: var(--green); }

/* Product grid */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.product-card { background: var(--white); border: 1px solid var(--border); border-radius: 4px; overflow: hidden; cursor: pointer; transition: box-shadow 0.15s; display: flex; flex-direction: column; }
.product-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.12); }
.product-card-img { width: 100%; height: 180px; background: var(--white); display: flex; align-items: center; justify-content: center; padding: 12px; }
.product-card-img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.product-card-body { padding: 12px; flex: 1; display: flex; flex-direction: column; }
.product-card-price { font-size: 20px; font-weight: 700; color: var(--text-dark); }
.product-card-unit { font-size: 12px; color: #767676; font-weight: 400; }
.product-card-name { font-size: 14px; font-weight: 400; margin: 4px 0 8px; line-height: 1.3; color: var(--text); flex: 1; }
.product-card-brand { font-size: 11px; color: #767676; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 2px; }
.product-card-add { width: 100%; padding: 9px; background: var(--green); color: var(--white); border: none; border-radius: 4px; font-family: inherit; font-size: 14px; font-weight: 700; cursor: pointer; transition: background 0.15s; }
.product-card-add:hover { background: var(--green-dark); }

/* Chat FAB */
.chat-fab { position: fixed; bottom: 24px; right: 24px; width: 56px; height: 56px; background: var(--green); border-radius: 50%; border: none; cursor: pointer; box-shadow: 0 4px 12px rgba(0,128,49,0.4); display: flex; align-items: center; justify-content: center; z-index: 1000; transition: all 0.2s; }
.chat-fab:hover { transform: scale(1.05); background: var(--green-dark); }
.chat-fab svg { width: 26px; height: 26px; fill: var(--white); }

/* Chat Panel */
.chat-panel { position: fixed; bottom: 0; right: 0; width: 400px; height: 100vh; background: var(--white); box-shadow: -2px 0 16px rgba(0,0,0,0.12); z-index: 1001; display: none; flex-direction: column; }
.chat-panel.open { display: flex; }
.chat-header { background: var(--green); padding: 16px; display: flex; align-items: center; justify-content: space-between; }
.chat-header-title { color: var(--white); font-size: 16px; font-weight: 700; }
.chat-header-actions { display: flex; gap: 8px; }
.chat-header-btn { background: rgba(255,255,255,0.15); border: none; width: 32px; height: 32px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background 0.2s; }
.chat-header-btn:hover { background: rgba(255,255,255,0.25); }
.chat-header-btn svg { width: 16px; height: 16px; fill: var(--white); }

/* Chat Messages */
.chat-messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.chat-msg { max-width: 82%; padding: 12px 16px; border-radius: 8px; font-size: 14px; line-height: 20px; }
.chat-msg.assistant { background: var(--bg); align-self: flex-start; border-bottom-left-radius: 2px; color: var(--text); }
.chat-msg.assistant:has(.chat-pcard-row) { max-width: 100%; width: 100%; background: transparent; padding: 4px 0; }
.chat-msg.user { background: var(--green); color: var(--white); align-self: flex-end; border-bottom-right-radius: 2px; }
.chat-msg a { color: var(--green); font-weight: 600; }
.chat-msg.user a { color: var(--gold); }

/* Product Card in Chat - storefront style (vertical, inline-block) */
.chat-pcard-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0; }
.chat-pcard { display: flex; flex-direction: column; width: calc(50% - 4px); background: var(--white); border: 1px solid var(--border); border-radius: 4px; overflow: hidden; cursor: pointer; transition: box-shadow 0.15s; }
.chat-pcard:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.12); }
.chat-pcard-img { display: flex; align-items: center; justify-content: center; height: 96px; padding: 8px; background: var(--white); }
.chat-pcard-img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.chat-pcard-noimg { font-size: 11px; color: #999; text-align: center; padding: 8px; }
.chat-pcard-price { font-size: 16px; font-weight: 700; color: var(--text-dark); padding: 8px 8px 0; }
.chat-pcard-unit { font-size: 10px; color: #767676; font-weight: 400; }
.chat-pcard-name { font-size: 12px; font-weight: 400; color: var(--text); line-height: 1.3; padding: 3px 8px 8px; min-height: 38px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.chat-pcard-add { margin: 0 8px 8px; padding: 7px; background: var(--green); color: var(--white); border: none; border-radius: 4px; font-family: inherit; font-size: 13px; font-weight: 700; cursor: pointer; transition: background 0.15s; }
.chat-pcard-add:hover { background: var(--green-dark); }
.chat-pcard-add:disabled { background: #8cc7a0; cursor: default; }

/* Quick Replies */
.quick-replies { padding: 8px 16px; display: flex; gap: 8px; flex-wrap: wrap; border-top: 1px solid var(--border); }
.quick-reply-btn { padding: 6px 14px; border: 1px solid var(--green); border-radius: 20px; background: var(--white); color: var(--green); font-family: inherit; font-size: 13px; font-weight: 600; cursor: pointer; transition: all 0.2s; white-space: nowrap; }
.quick-reply-btn:hover { background: var(--green); color: var(--white); }

/* Chat Input */
.chat-input-area { padding: 12px 16px; border-top: 1px solid var(--border); display: flex; gap: 8px; }
.chat-input { flex: 1; padding: 10px 14px; border: 1px solid var(--border); border-radius: 4px; font-family: inherit; font-size: 14px; height: 42px; outline: none; transition: border-color 0.2s; }
.chat-input:focus { border-color: var(--green); }
.chat-voice { width: 42px; height: 42px; background: transparent; border: 1px solid var(--border); border-radius: 4px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.2s; }
.chat-voice svg { width: 20px; height: 20px; fill: #767676; }
.chat-voice:hover { border-color: var(--green); }
.chat-voice:hover svg { fill: var(--green); }
.chat-voice.unsupported { opacity: 0.5; }
.chat-voice.unsupported:hover { border-color: var(--border); }
.chat-voice.unsupported:hover svg { fill: #767676; }
.chat-voice.recording { background: #B00020; border-color: #B00020; animation: pulse-record 1.5s infinite; }
.chat-voice.recording svg { fill: var(--white); }
@keyframes pulse-record { 0%,100% { box-shadow: 0 0 0 0 rgba(176,0,32,0.4); } 50% { box-shadow: 0 0 0 8px rgba(176,0,32,0); } }
.chat-send { width: 42px; height: 42px; background: var(--green); border: none; border-radius: 4px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background 0.2s; }
.chat-send:hover { background: var(--green-dark); }
.chat-send svg { width: 18px; height: 18px; fill: var(--white); }

/* Typing Indicator */
.typing-indicator { display: flex; gap: 4px; padding: 12px 16px; align-self: flex-start; }
.typing-indicator span { width: 7px; height: 7px; background: var(--border); border-radius: 50%; animation: typing 1.4s infinite; }
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing { 0%,60%,100% { transform: translateY(0); } 30% { transform: translateY(-5px); } }

/* Welcome & Personas */
.chat-welcome { padding: 16px; text-align: center; }
.chat-welcome h3 { color: var(--green); margin-bottom: 8px; font-size: 18px; font-weight: 700; }
.chat-welcome p { color: #767676; font-size: 14px; margin-bottom: 16px; }
.welcome-options { display: flex; flex-direction: column; gap: 8px; }
.welcome-option { padding: 16px; border: 1px solid var(--border); border-radius: 4px; cursor: pointer; transition: all 0.2s; text-align: left; }
.welcome-option:hover { border-color: var(--green); background: #f0faf4; }
.welcome-option h4 { font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.welcome-option p { font-size: 12px; color: #767676; margin: 0; }
.persona-cards { display: flex; flex-direction: column; gap: 8px; padding: 16px; }
.persona-card { display: flex; align-items: center; gap: 12px; padding: 16px; border: 1px solid var(--border); border-radius: 4px; cursor: pointer; transition: all 0.2s; position: relative; }
.persona-card:hover { border-color: var(--green); background: #f0faf4; }
.persona-avatar { font-size: 32px; }
.persona-info h4 { font-size: 14px; font-weight: 700; }
.persona-info p { font-size: 12px; color: #767676; margin-top: 2px; }
.persona-tooltip { display: none; position: absolute; bottom: calc(100% + 8px); left: 0; right: 0; background: var(--text-dark); color: var(--white); border-radius: 4px; padding: 12px; box-shadow: 0 4px 12px rgba(0,0,0,0.15); font-size: 12px; z-index: 10; }
.persona-card:hover .persona-tooltip { display: block; }
.persona-tooltip strong { display: block; margin-bottom: 4px; color: var(--gold); }

/* Product Page */
.product-page { max-width: 1000px; margin: 0 auto; padding: 32px 20px; display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.product-page-img { width: 100%; border-radius: 4px; background: var(--white); border: 1px solid var(--border); aspect-ratio: 1; object-fit: contain; padding: 24px; }
.product-page-name { font-size: 26px; font-weight: 700; }
.product-page-brand { font-size: 12px; color: #767676; font-weight: 600; text-transform: uppercase; margin-bottom: 8px; }
.product-page-price { font-size: 32px; font-weight: 700; color: var(--text-dark); margin: 12px 0; }
.product-page-desc { font-size: 16px; color: var(--text); line-height: 1.6; margin-bottom: 24px; }
.btn-add-bag { padding: 12px 32px; background: var(--green); color: var(--white); border: none; border-radius: 4px; font-family: inherit; font-size: 16px; font-weight: 700; cursor: pointer; transition: background 0.2s; }
.btn-add-bag:hover { background: var(--green-dark); }

/* Checkout */
.checkout-page { max-width: 700px; margin: 0 auto; padding: 32px 20px; }
.basket-item { display: flex; align-items: center; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--border); }
.basket-item img { width: 56px; height: 56px; border-radius: 4px; object-fit: contain; background: var(--white); border: 1px solid var(--border); }
.basket-item-info { flex: 1; }
.basket-item-name { font-size: 14px; font-weight: 600; }
.basket-item-price { font-size: 16px; color: var(--text-dark); font-weight: 700; }
.basket-total { font-size: 22px; font-weight: 700; text-align: right; padding: 16px 0; border-top: 2px solid var(--text-dark); margin-top: 16px; }
.btn-checkout { display: block; width: 100%; padding: 14px; background: var(--gold); color: var(--text-dark); border: none; border-radius: 4px; font-family: inherit; font-size: 16px; font-weight: 700; cursor: pointer; margin-top: 16px; transition: background 0.2s; }
.btn-checkout:hover { background: var(--gold-dark); }
