/* Base & variables */
*,
*::before,
*::after { box-sizing: border-box; }
:root {
    --color-primary: #1a5f3a;
    --color-accent: #c9a227;
    --color-background: #faf8f5;
    --color-surface: #fff;
    --color-text: #1a1a1a;
    --color-text-muted: #5c5c5c;
    --font-family: 'Cormorant Garamond', Georgia, serif;
    --transition: 0.3s ease;
}
body { margin: 0; font-family: var(--font-family); background: var(--color-background); color: var(--color-text); transition: background-color 0.4s ease, color 0.4s ease; }
#app { display: flex; flex-direction: column; min-height: 100vh; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }

/* Header - fixed at top to ensure it never appears below content */
.header { position: fixed; top: 0; left: 0; right: 0; flex-shrink: 0; z-index: 100; background: var(--color-surface); padding: 1rem 2rem; box-shadow: 0 1px 4px rgba(0,0,0,.08); transition: background-color 0.4s ease; }
.header__inner { display: flex; align-items: center; justify-content: space-between; max-width: 1200px; margin: 0 auto; }
.header__logo-img { height: 40px; width: auto; }
.nav__list { display: flex; gap: 1.5rem; list-style: none; margin: 0; padding: 0; }
.nav__link { font-weight: 500; }
.nav__link:hover { color: var(--color-primary); }
.header__actions { display: flex; align-items: center; gap: 0.5rem; color: var(--color-text); transition: color 0.4s ease; }
.header__actions > * { display: flex; align-items: center; justify-content: center; }
.header__actions a, .header__actions button { color: inherit; }
.header__theme-toggle { color: inherit; }
.header__fav, .header__cart { font-size: 1.25rem; transition: transform 0.2s; min-width: 2rem; justify-content: center; }
.header__fav:hover, .header__cart:hover { transform: scale(1.1); }
.language-switcher { display: flex; align-items: center; justify-content: center; color: inherit; }
.language-switcher .lang-btn { display: flex; align-items: center; justify-content: center; background: none; border: none; cursor: pointer; padding: 0.35rem 0.6rem; min-width: 2.5rem; min-height: 2rem; border-radius: 6px; transition: var(--transition); color: inherit; font-size: 0.9rem; font-weight: 500; }
.language-switcher .lang-btn:hover { color: var(--color-primary); background: rgba(0,0,0,.05); }
.lang-btn__wrap { display: inline-block; overflow: hidden; height: 1.2em; line-height: 1.2; position: relative; min-width: 1.5em; }
.lang-btn__wrap .lang-btn__current { display: block; }
.lang-dropdown { position: relative; display: flex; align-items: center; }
.lang-dropdown .lang-btn--trigger { display: flex; align-items: center; justify-content: center; gap: 0.25rem; min-width: 2.5rem; min-height: 2rem; }
.lang-dropdown__list { position: absolute; top: 100%; right: 0; margin: 0.25rem 0 0; padding: 0.25rem 0; list-style: none; background: var(--color-surface); border-radius: 6px; box-shadow: 0 4px 12px rgba(0,0,0,.15); min-width: 100%; z-index: 100; }
.lang-dropdown__list[hidden] { display: none !important; }
.lang-dropdown__list li { padding: 0.4rem 0.75rem; cursor: pointer; display: flex; align-items: center; gap: 0.5rem; }
.lang-dropdown__list li:hover { background: rgba(0,0,0,.06); }
.lang-dropdown__icon { font-size: 0.65em; transition: transform 0.2s; }
.lang-dropdown .lang-btn--trigger[aria-expanded="true"] .lang-dropdown__icon { transform: rotate(180deg); }
.header__theme-toggle { background: none; border: none; cursor: pointer; font-size: 1.25rem; position: relative; width: 2rem; height: 2rem; display: flex; align-items: center; justify-content: center; }
.theme-icon { position: absolute; inset: 0; margin: auto; display: flex; align-items: center; justify-content: center; transition: transform 0.4s ease, opacity 0.4s ease; color: inherit; }
.theme-icon--moon { opacity: 0; }
html.theme-dark .theme-icon--sun, .theme-dark .theme-icon--sun { opacity: 0; transform: rotate(-90deg) scale(0.5); }
html.theme-dark .theme-icon--moon, .theme-dark .theme-icon--moon { opacity: 1; transform: rotate(0); }
html.theme-light .theme-icon--sun, .theme-light .theme-icon--sun { opacity: 1; transform: rotate(0); }
html.theme-light .theme-icon--moon, .theme-light .theme-icon--moon { opacity: 0; transform: rotate(90deg) scale(0.5); }

/* Main - add top padding so content doesn't hide under fixed header (~60px) */
.main-content { flex: 1; min-height: 0; max-width: 1200px; width: 100%; margin: 0 auto; padding: 2rem; padding-top: calc(2rem + 60px); transition: color 0.4s ease; box-sizing: border-box; }

/* Slider */
.slider { padding: 4rem 2rem; text-align: center; background: linear-gradient(135deg, var(--color-primary) 0%, #0f3520 100%); color: #fff; }
.slider__title { font-size: 2.5rem; margin: 0 0 0.5rem; }
.slider__subtitle { margin: 0 0 1.5rem; opacity: .9; }
.slider__badges { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.75rem; margin-top: 2rem; }
.badge { padding: 0.4rem 0.8rem; background: rgba(255,255,255,.2); border-radius: 999px; font-size: 0.85rem; display: inline-flex; align-items: center; gap: 0.35rem; }

/* Buttons */
.btn { display: inline-block; padding: 0.6rem 1.2rem; border-radius: 6px; font-weight: 500; cursor: pointer; border: none; transition: var(--transition); }
.btn--primary { background: var(--color-primary); color: #fff; }
.btn--primary:hover { opacity: .9; transform: translateY(-1px); }
.btn--sm { padding: 0.4rem 0.8rem; font-size: 0.9rem; }
.btn--lg { padding: 0.75rem 1.5rem; font-size: 1.1rem; }

/* Product grid */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1.5rem; }
.product-card { background: var(--color-surface); border-radius: 8px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,.06); transition: var(--transition), background-color 0.4s ease; position: relative; }
.product-card__link { color: inherit; display: block; text-decoration: none; }
.product-card__link:hover { color: inherit; }
.product-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.1); transform: translateY(-2px); }
.product-card__image-wrap { aspect-ratio: 1; position: relative; overflow: hidden; background: #f5f5f5; }
.product-card__img { width: 100%; height: 100%; object-fit: cover; }
.product-card__image-wrap--slider .product-card__slider { position: relative; width: 100%; height: 100%; overflow: hidden; }
.product-card__image-wrap--slider .product-card__slider .product-card__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity 0.5s ease; opacity: 0; }
.product-card__image-wrap--slider .product-card__slider .product-card__img.active { opacity: 1; position: relative; z-index: 1; }
.product-card__fav { position: absolute; top: 0.5rem; right: 0.5rem; background: rgba(255,255,255,.9); border: none; width: 36px; height: 36px; border-radius: 50%; cursor: pointer; font-size: 1rem; z-index: 2; transition: transform 0.2s; }
.product-card__fav:hover { transform: scale(1.1); }
.product-card__fav:active { transform: scale(0.95); }
.product-card__fav.active { color: #c00; }
.product-card__fav.active i { animation: favPop 0.3s ease; }
@keyframes favPop { 0% { transform: scale(1); } 50% { transform: scale(1.3); } 100% { transform: scale(1); } }
.product-card__badge { position: absolute; top: 0.5rem; left: 0.5rem; background: var(--color-accent); color: #fff; padding: 0.2rem 0.5rem; font-size: 0.75rem; font-weight: 600; border-radius: 4px; z-index: 2; }
.product-card__name { padding: 0.75rem 1rem 0; margin: 0; font-size: 1rem; }
.product-card__price { padding: 0.25rem 1rem; }
.price--current { font-weight: 600; color: var(--color-primary); }
.price--original { font-size: 0.85rem; color: var(--color-text-muted); text-decoration: line-through; margin-left: 0.5rem; }
.product-card__add-wrap { margin: 0.5rem 1rem 1rem; display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.product-card__add { flex: 1; min-width: 0; }
.product-card__qty { display: flex; align-items: center; gap: 0; border: 1px solid rgba(0,0,0,.15); border-radius: 6px; overflow: hidden; }
.product-card__qty-btn { width: 32px; height: 32px; border: none; background: var(--color-surface); cursor: pointer; font-size: 1rem; color: var(--color-text); transition: background 0.2s; }
.product-card__qty-btn:hover { background: rgba(0,0,0,.06); }
.product-card__qty-val { min-width: 2rem; text-align: center; font-weight: 600; font-size: 0.9rem; transition: transform 0.15s ease; }

/* Shop */
.page-header { margin-bottom: 2rem; }
.shop-toolbar { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 1rem; align-items: center; }
.shop-search { flex: 1; padding: 0.6rem 1rem; border: 1px solid #ddd; border-radius: 6px; }
.shop-sort-dropdown { position: relative; }
.shop-sort__trigger { display: flex; align-items: center; gap: 0.5rem; padding: 0.6rem 1rem; border: 1px solid #ddd; border-radius: 6px; background: var(--color-surface); cursor: pointer; font-size: 0.95rem; color: var(--color-text); transition: var(--transition); }
.shop-sort__trigger:hover { border-color: var(--color-primary); color: var(--color-primary); }
.shop-sort__icon { font-size: 0.9em; opacity: 0.8; }
.shop-sort__chevron { font-size: 0.65em; margin-left: 0.25rem; transition: transform 0.2s; }
.shop-sort-dropdown[data-open] .shop-sort__chevron { transform: rotate(180deg); }
.shop-sort__list { position: absolute; top: 100%; right: 0; margin: 0.25rem 0 0; padding: 0.25rem 0; list-style: none; background: var(--color-surface); border-radius: 6px; box-shadow: 0 4px 12px rgba(0,0,0,.15); min-width: 100%; z-index: 100; }
.shop-sort__list[hidden] { display: none !important; }
.shop-sort__list li { display: flex; align-items: center; gap: 0.6rem; padding: 0.5rem 1rem; cursor: pointer; }
.shop-sort__list li:hover { background: rgba(0,0,0,.06); }
.shop-sort__list li i { width: 1em; text-align: center; opacity: 0.8; }
.shop-categories { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.shop-cat-btn { padding: 0.4rem 0.8rem; border-radius: 6px; font-size: 0.9rem; background: var(--color-surface); border: 1px solid #ddd; }
.shop-cat-btn:hover, .shop-cat-btn.active { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }

/* Cart */
.cart-content { display: grid; grid-template-columns: 1fr 300px; gap: 2rem; }
.cart-items { min-height: 100px; display: flex; flex-direction: column; gap: 1rem; }
.cart-item { display: flex; align-items: center; gap: 1rem; padding: 1rem; background: var(--color-surface); border-radius: 8px; box-shadow: 0 2px 6px rgba(0,0,0,.06); transition: background-color 0.4s ease; }
.cart-summary { background: var(--color-surface); padding: 1.5rem; border-radius: 8px; height: fit-content; transition: background-color 0.4s ease; }
.cart-total__original { text-decoration: line-through; color: var(--color-text-muted); font-weight: 400; margin-right: 0.5rem; }
.cart-total__current { font-weight: 600; color: var(--color-primary); }
.cart-item__img { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; flex-shrink: 0; }
.cart-item__info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cart-item__name { font-weight: 600; display: block; margin-bottom: 0.25rem; }
.cart-item__desc { font-size: 0.85rem; color: var(--color-text-muted); margin-bottom: 0.5rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cart-item__price-row { display: flex; flex-direction: column; align-items: flex-end; gap: 0.25rem; margin-bottom: 0.5rem; }
.cart-item__price { font-weight: 600; color: var(--color-primary); text-align: right; }
.cart-item__price-original { font-size: 0.85rem; color: var(--color-text-muted); text-decoration: line-through; }
.cart-item__actions { display: flex; align-items: center; gap: 0.5rem; }
.cart-item__qty { display: flex; align-items: center; gap: 0; border: 1px solid rgba(0,0,0,.15); border-radius: 6px; overflow: hidden; }
.cart-item__qty-btn { width: 28px; height: 28px; border: none; background: rgba(0,0,0,.08); cursor: pointer; font-size: 0.9rem; color: var(--color-text); }
.cart-item__qty-btn:hover { background: rgba(0,0,0,.08); }
.cart-item__qty-val { min-width: 1.5rem; text-align: center; font-size: 0.85rem; transition: transform 0.15s ease; }
.cart-item__remove { padding: 0.25rem 0.5rem; font-size: 0.75rem; color: var(--color-text-muted); background: none; border: none; cursor: pointer; }
.cart-item__remove:hover { color: #c00; }
.cart-empty, .favorites-empty { display: none; text-align: center; padding: 2rem; color: var(--color-text-muted); }
.cart-empty.visible, .favorites-empty.visible { display: block; }

/* Email updates */
.email-updates { display: flex; gap: 0.5rem; margin-top: 1rem; flex-wrap: wrap; max-width: 400px; }
.email-updates__input { flex: 1; min-width: 180px; padding: 0.6rem 1rem; border: 1px solid #ddd; border-radius: 6px; font-size: 1rem; }
.email-updates__input:focus { outline: none; border-color: var(--color-primary); }

/* Email form */
.email-form { margin: 1rem 0; }
.email-form__label { display: block; margin-top: 0.75rem; font-weight: 500; }
.email-form__input, .email-form__textarea { width: 100%; padding: 0.6rem; margin-top: 0.25rem; border: 1px solid #ddd; border-radius: 6px; }

/* Footer */
.footer { flex-shrink: 0; background: var(--color-surface); padding: 2rem; margin-top: 3rem; text-align: center; transition: background-color 0.4s ease, color 0.4s ease; }
.footer__links { display: flex; justify-content: center; gap: 1.5rem; margin: 0.5rem 0; }
.footer__links a:hover { color: var(--color-primary); }
.footer__copy { margin: 1rem 0 0; font-size: 0.85rem; color: var(--color-text-muted); }

/* Legal */
.page-header--product { margin-bottom: 1.5rem; }
.page-legal .legal-content { max-width: 720px; line-height: 1.6; }
.legal-text { margin-top: 1rem; }
.legal-nav { display: flex; gap: 1rem; margin-bottom: 2rem; }
.legal-nav a { padding: 0.5rem 1rem; border-radius: 6px; }
.legal-nav a.active { background: var(--color-primary); color: #fff; }
.faq-item { margin-bottom: 1.5rem; }
.faq-item h3 { margin: 0 0 0.5rem; }
.page-about .about-content { max-width: 720px; line-height: 1.6; }

/* Loader */
.loader { position: fixed; inset: 0; background: rgba(255,255,255,.8); display: flex; align-items: center; justify-content: center; z-index: 9999; opacity: 0; pointer-events: none; transition: opacity .3s; }
.loader.visible { opacity: 1; pointer-events: auto; }
.loader::after { content: ''; width: 40px; height: 40px; border: 3px solid var(--color-primary); border-top-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Product detail */
.page-product { max-width: 100%; }
.product-detail__back { display: inline-block; margin-bottom: 1.5rem; color: var(--color-text-muted); }
.product-detail__back:hover { color: var(--color-primary); }
.product-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: start; max-width: 100%; }
.product-detail__gallery { position: sticky; top: 1rem; }
.product-detail__main-img-wrap { aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: #f5f5f5; margin-bottom: 0.75rem; }
.product-detail__main-img { width: 100%; height: 100%; object-fit: cover; }
.product-detail__thumbs { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.product-detail__thumb { padding: 0; border: 2px solid transparent; border-radius: 6px; overflow: hidden; cursor: pointer; background: none; width: 64px; height: 64px; flex-shrink: 0; }
.product-detail__thumb.active { border-color: var(--color-primary); }
.product-detail__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.product-detail__badge { display: inline-block; background: var(--color-accent); color: #fff; padding: 0.2rem 0.5rem; font-size: 0.75rem; font-weight: 600; border-radius: 4px; margin-bottom: 0.5rem; }
.product-detail__name { font-size: 1.75rem; margin: 0 0 0.25rem; }
.product-detail__category { color: var(--color-text-muted); font-size: 0.9rem; margin: 0 0 1rem; }
.product-detail__price { margin-bottom: 1rem; }
.product-detail__desc { margin-bottom: 1.5rem; line-height: 1.6; white-space: pre-wrap; }
.product-detail__actions { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.product-detail__add-wrap { min-width: 120px; }
.product-detail__fav { width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(0,0,0,.15); background: var(--color-surface); cursor: pointer; font-size: 1.1rem; transition: var(--transition); color: var(--color-text); }
.product-detail__fav:hover { transform: scale(1.05); }
.product-detail__fav.active { color: #c00; border-color: #c00; }
@media (max-width: 768px) { .product-detail { grid-template-columns: 1fr; } }

/* Section */
.section { margin: 3rem 0; }
.section__title { font-size: 1.75rem; margin: 0 0 0.25rem; }
.section__subtitle { color: var(--color-text-muted); margin: 0 0 1.5rem; }
.section .btn, .section .btn--primary { margin-top: 1.5rem; }
