:root {
  --blue: #0d2c4d;
  --green: #4a8c63;
  --cream: #f7f5f0;
  --line: #e2e3dc;
  --text: #172337;
  --muted: #6e746b;
}

* { box-sizing: border-box; }
html { max-width: 100%; overflow-x: hidden; }
body { margin: 0; max-width: 100%; overflow-x: hidden; color: var(--text); background: var(--cream); font-family: Arial, sans-serif; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
main { min-height: 60vh; }
.logo-img { width: auto; max-width: 240px; max-height: 82px; object-fit: contain; }
.logo-preview { width: auto; max-width: 260px; max-height: 120px; object-fit: contain; padding: 12px; border: 1px solid var(--line); border-radius: 18px; background: #fff; }
.favicon-preview { width: 48px; height: 48px; object-fit: contain; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.topbar { display: flex; justify-content: center; gap: 64px; padding: 12px 20px; color: #fff; background: var(--blue); font-size: 14px; font-weight: 700; }
.site-header { display: grid; grid-template-columns: minmax(220px, 320px) minmax(220px, 1fr) auto; align-items: center; gap: 28px; padding: 24px 5vw; background: #fff; border-bottom: 1px solid var(--line); }
.logo { display: flex; align-items: center; gap: 16px; }
.logo small { display: block; color: var(--green); font-family: Georgia, serif; font-size: 24px; line-height: 1; }
.logo strong { display: block; color: var(--blue); font-family: Georgia, serif; font-size: 48px; line-height: .88; }
.logo-house { position: relative; width: 72px; height: 70px; border-left: 6px solid var(--blue); border-bottom: 6px solid var(--blue); border-radius: 0 0 0 12px; transform: skewY(-2deg); }
.logo-house:before { content: ''; position: absolute; left: -5px; top: 14px; width: 60px; height: 60px; border-top: 6px solid var(--blue); border-right: 6px solid var(--blue); transform: rotate(-45deg); border-radius: 6px; }
.logo-house span { position: absolute; left: 30px; top: 28px; width: 24px; height: 24px; background: linear-gradient(90deg, var(--green) 0 45%, transparent 45% 55%, var(--green) 55%), linear-gradient(var(--green) 0 45%, transparent 45% 55%, var(--green) 55%); border-radius: 4px; }
.search { display: flex; background: #f2f4f1; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.search input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 15px 20px; font-size: 15px; outline: none; }
.search button, .btn { border: 0; border-radius: 999px; padding: 13px 22px; color: #fff; background: var(--green); font-weight: 700; cursor: pointer; }
.btn.secondary { background: var(--blue); }
.btn.light { color: var(--blue); background: #fff; border: 1px solid var(--line); }
.btn.outline-strong { color: var(--blue); background: #fff; border: 2px solid var(--blue); box-shadow: 0 8px 20px rgba(13, 44, 77, .10); }
.btn.outline-strong:hover { color: #fff; background: var(--blue); transform: translateY(-2px); }
.btn.continue-shopping { color: var(--green); background: #fff; border: 2px solid var(--green); box-shadow: 0 8px 20px rgba(74, 140, 99, .14); }
.btn.continue-shopping:hover { color: #fff; background: var(--green); transform: translateY(-2px); }
.btn.remove-item { padding: 10px 14px; color: #8d1f1f; background: #fff; border: 2px solid #e7c3c3; }
.btn.remove-item:hover { color: #fff; background: #8d1f1f; border-color: #8d1f1f; }
.header-actions { display: flex; align-items: center; gap: 14px; font-size: 14px; font-weight: 700; color: var(--blue); }
.account-link { padding: 12px 18px; color: var(--blue); background: #f2f4f1; border: 1px solid var(--line); border-radius: 999px; transition: transform .18s ease, box-shadow .18s ease, background .18s ease; }
.account-link:hover { background: #fff; box-shadow: 0 10px 24px rgba(13, 44, 77, .14); transform: translateY(-3px); }
.cart-link { display: inline-flex; align-items: center; gap: 8px; padding: 12px 18px; color: #fff; background: var(--green); border-radius: 999px; }
.cart-link svg, .cart-add-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cart-link span { display: inline-grid; min-width: 24px; height: 24px; place-items: center; padding: 0 7px; color: var(--green); background: #fff; border-radius: 999px; font-size: 12px; }
.main-nav { display: flex; justify-content: center; gap: 12px; padding: 16px 5vw; background: #fff; border-bottom: 1px solid var(--line); color: var(--blue); font-size: 14px; font-weight: 700; }
.main-nav a { position: relative; padding: 10px 14px; border-radius: 999px; transition: transform .18s ease, box-shadow .18s ease, background .18s ease, color .18s ease; }
.main-nav a:hover, .main-nav a.active { color: #fff; background: var(--green); box-shadow: 0 12px 26px rgba(13, 44, 77, .18); transform: translateY(-4px); }
.main-nav a.active:after { content: ''; position: absolute; left: 50%; bottom: -8px; width: 8px; height: 8px; background: var(--green); border-radius: 50%; transform: translateX(-50%); }
.hero { display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; margin: 42px auto; max-width: 1240px; padding: 70px; border-radius: 34px; color: #fff; background: radial-gradient(circle at 86% 28%, #4a8c63 0 13%, #143c66 14% 30%, var(--blue) 31%); }
.hero h1 { margin: 0; font-family: Georgia, serif; font-size: clamp(42px, 6vw, 76px); line-height: 1; }
.hero p { max-width: 650px; color: #d6e2d8; font-size: 21px; line-height: 1.5; }
.hero-card { padding: 30px; border-radius: 28px; color: var(--blue); background: rgba(255,255,255,.96); box-shadow: 0 24px 80px rgba(0,0,0,.18); }
.section { max-width: 1240px; margin: 52px auto; padding: 0 24px; }
.section-title { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
h2 { margin: 0; color: var(--blue); font-family: Georgia, serif; font-size: 38px; }
.muted { color: var(--muted); }
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.category-grid { grid-template-columns: repeat(5, 1fr); }
.card { background: #fff; border: 1px solid var(--line); border-radius: 24px; overflow: hidden; }
.card-body { padding: 20px; }
.category-card { display: flex; flex-direction: column; min-height: 220px; color: var(--blue); }
.category-card strong { display: block; padding: 18px 20px 20px; }
.category-icon { width: 100%; aspect-ratio: 16 / 10; background: #e9efea; }
.category-image { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: center; background: #e9efea; }
.product-image { aspect-ratio: 4 / 3; object-fit: cover; width: 100%; background: #f1eee7; }
.product-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: start; }
.product-gallery { display: grid; gap: 14px; }
.product-main-image { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border: 1px solid var(--line); border-radius: 24px; background: #f1eee7; }
.product-thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.product-thumb { padding: 0; border: 2px solid transparent; border-radius: 16px; background: #fff; cursor: pointer; overflow: hidden; }
.product-thumb.active { border-color: var(--green); box-shadow: 0 10px 22px rgba(74, 140, 99, .18); }
.product-thumb img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }
.price { color: var(--blue); font-size: 24px; font-weight: 800; }
.pix-price { margin-top: -8px; color: var(--green); font-weight: 800; }
.pix-price.large { margin-top: 0; font-size: 20px; }
.product-info-sections { display: grid; gap: 22px; }
.product-tab-links { display: grid; border-top: 1px solid var(--line); background: #fff; }
.product-card-links { margin-top: 22px; }
.tab-link-mobile { display: flex; align-items: center; justify-content: space-between; min-height: 42px; padding: 0 2px; color: var(--text); border-bottom: 1px solid var(--line); font-size: 14px; font-weight: 700; }
.tab-link-mobile .text { display: block; padding: 12px 0; }
.tab-link-mobile:after { content: '⌄'; color: var(--blue); font-size: 14px; line-height: 1; }
.tab-link-mobile:hover { color: var(--green); }
.product-info-content { padding-top: 4px; scroll-margin-top: 120px; }
.product-info-content h2 { margin-bottom: 16px; font-size: 28px; }
.product-info-content p { color: var(--text); line-height: 1.7; }
.product-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 16px; }
.product-actions input { width: 70px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; }
.cart-add-btn { display: inline-flex; align-items: center; gap: 8px; background: var(--blue); }
.cart-subtotal { margin: 18px 0 4px; padding: 16px 18px; border-radius: 16px; color: var(--blue); background: #f2f4f1; font-size: 18px; }
.cart-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 16px; }
.benefits { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.benefit { padding: 24px; background: #fff; border: 1px solid var(--line); border-radius: 22px; }
.page { max-width: 1040px; margin: 42px auto; padding: 0 24px; }
.account-header { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 28px; padding: 22px 24px; background: #fff; border: 1px solid var(--line); border-radius: 24px; }
.form-card, .table-card { padding: 28px; background: #fff; border: 1px solid var(--line); border-radius: 24px; }
.table-card { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { min-width: 760px; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.login-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 22px; align-items: stretch; }
.login-side { background: linear-gradient(135deg, #fff, #e9efea); }
.account-helper-link { color: var(--blue); font-weight: 700; text-decoration: underline; text-underline-offset: 4px; }
label { display: grid; gap: 7px; color: var(--blue); font-weight: 700; }
input, select, textarea { width: 100%; padding: 13px 14px; border: 1px solid var(--line); border-radius: 14px; font: inherit; }
textarea { min-height: 120px; resize: vertical; }
.notice { padding: 14px 18px; margin-bottom: 18px; border-radius: 16px; background: #e4f1e8; color: var(--blue); font-weight: 700; }
.danger { color: #8d1f1f; }
.danger-zone { border-color: #e7c3c3; background: #fffafa; }
.admin-nav { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.admin-nav .active-admin { color: #fff; background: var(--blue); border-color: var(--blue); box-shadow: 0 10px 24px rgba(13, 44, 77, .18); transform: translateY(-2px); }
.admin-logout { margin-left: auto; background: #8d1f1f; }
.admin-logout:hover { background: #681515; transform: translateY(-2px); }
.thumb { width: 78px; height: 58px; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); background: #f1eee7; }
.image-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; margin-top: 20px; }
.image-item { padding: 12px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.inactive-row { background: #fff4f4; color: #8d1f1f; }
.inactive-row td:nth-child(2) { text-decoration: line-through; }
.site-footer { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 30px; margin-top: 70px; padding: 48px 5vw; color: #fff; background: var(--blue); }
.site-footer a { display: block; margin: 8px 0; color: #d6e2d8; }
.cart-drawer-backdrop { position: fixed; inset: 0; z-index: 80; background: rgba(13, 44, 77, .35); opacity: 0; pointer-events: none; transition: opacity .2s ease; }
.cart-drawer { position: fixed; top: 0; right: 0; z-index: 90; width: min(420px, 92vw); height: 100vh; padding: 28px; background: #fff; box-shadow: -18px 0 50px rgba(13, 44, 77, .22); transform: translateX(110%); transition: transform .24s ease; overflow: auto; }
.cart-drawer.open { display: block; visibility: visible; transform: translateX(0); }
.cart-drawer-backdrop.open { opacity: 1; pointer-events: auto; }
.cart-drawer-close { float: right; border: 0; color: var(--blue); background: transparent; font-weight: 700; cursor: pointer; }
.cart-drawer-product { padding: 14px 16px; border-radius: 16px; background: #e4f1e8; color: var(--blue); font-weight: 700; }
.cart-drawer-actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 18px 0 26px; }
.drawer-product { display: grid; grid-template-columns: 74px 1fr; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.drawer-product img { width: 74px; height: 58px; object-fit: cover; border-radius: 12px; background: #f1eee7; }
.drawer-product strong { display: block; color: var(--blue); }
.drawer-product span { color: var(--green); font-weight: 700; }

@media (max-width: 1100px) {
  .site-header { grid-template-columns: 1fr; }
  .header-actions { justify-content: flex-start; }
  .main-nav { justify-content: flex-start; overflow-x: auto; white-space: nowrap; }
  .grid { grid-template-columns: repeat(2, 1fr); }
  .category-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 900px) {
  .topbar { gap: 16px; justify-content: flex-start; overflow: auto; white-space: nowrap; }
  .site-header { grid-template-columns: 1fr; gap: 18px; padding: 18px 24px; }
  .header-actions { justify-content: space-between; width: 100%; }
  .logo strong { font-size: 40px; }
  .logo-img { max-width: 210px; max-height: 74px; }
  .main-nav { justify-content: flex-start; overflow: auto; gap: 10px; white-space: nowrap; }
  .hero { grid-template-columns: 1fr; margin: 24px; padding: 38px 28px; }
  .grid, .category-grid, .benefits, .form-grid, .login-grid, .site-footer { grid-template-columns: 1fr 1fr; }
  .page > .grid { grid-template-columns: 1fr !important; }
  .product-detail-grid { grid-template-columns: 1fr; }
  h2 { font-size: 30px; }
  .section-title { align-items: flex-start; flex-direction: column; }
  table { font-size: 14px; }
}

@media (max-width: 640px) {
  .topbar { padding: 10px 16px; font-size: 12px; }
  .site-header { padding: 16px; }
  .logo { justify-content: center; }
  .logo-house { width: 54px; height: 54px; border-left-width: 5px; border-bottom-width: 5px; }
  .logo-house:before { width: 45px; height: 45px; border-top-width: 5px; border-right-width: 5px; }
  .logo-house span { left: 22px; top: 23px; width: 18px; height: 18px; }
  .logo small { font-size: 18px; }
  .logo strong { font-size: 34px; }
  .logo-img { max-width: 190px; max-height: 70px; }
  .search { border-radius: 18px; }
  .search input { padding: 13px 14px; font-size: 14px; }
  .search button { padding: 12px 14px; }
  .header-actions { gap: 10px; font-size: 13px; }
  .account-link, .cart-link { flex: 1; justify-content: center; }
  .cart-link { padding: 11px 14px; }
  .main-nav { padding: 14px 16px; font-size: 13px; }
  .hero { margin: 16px; padding: 30px 22px; border-radius: 24px; background: radial-gradient(circle at 100% 8%, #4a8c63 0 15%, #143c66 16% 32%, var(--blue) 33%); }
  .hero h1 { font-size: 38px; }
  .hero p { font-size: 16px; }
  .hero .btn { display: block; width: 100%; margin-top: 10px; text-align: center; }
  .hero-card { padding: 22px; }
  .section { margin: 38px auto; padding: 0 16px; }
  .grid, .category-grid, .benefits, .form-grid, .login-grid, .site-footer { grid-template-columns: 1fr; }
  .card-body, .benefit, .form-card, .table-card { padding: 18px; border-radius: 20px; }
  .category-card { min-height: 240px; border-radius: 20px; }
  .category-card strong { padding: 16px 18px 18px; }
  .account-header { align-items: stretch; flex-direction: column; padding: 18px; border-radius: 20px; }
  .account-header .btn { width: 100%; }
  .product-actions { align-items: stretch; flex-direction: column; }
  .product-thumbs { grid-template-columns: repeat(4, minmax(64px, 1fr)); gap: 8px; }
  .tab-link-mobile { padding: 0; }
  .product-actions input { width: 100%; }
  .btn { width: auto; text-align: center; }
  .cart-actions { display: grid; grid-template-columns: 1fr; gap: 12px; }
  .cart-actions .btn { display: block; width: 100%; white-space: normal; line-height: 1.25; }
  .admin-nav .btn, .admin-nav a { flex: 1 1 auto; text-align: center; }
  .page { margin: 28px auto; padding: 0 16px; }
  th, td { padding: 10px; }
  .site-footer { margin-top: 44px; padding: 34px 24px; }
}

@media (max-width: 420px) {
  .topbar span { font-size: 11px; }
  .logo-img { max-width: 165px; }
  .header-actions { flex-direction: column; align-items: stretch; }
  .search { flex-direction: column; border-radius: 18px; }
  .search button { border-radius: 0 0 18px 18px; }
  .hero h1 { font-size: 32px; }
  .btn { width: 100%; }
}
