@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600&family=Work+Sans:wght@400;500;600&display=swap');

* { box-sizing: border-box; }
body { margin: 0; font-family: 'Work Sans', sans-serif; background: #F6F1E6; color: #2A2521; line-height: 1.5; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* ---------------- Storefront header ---------------- */
.site-header { position: sticky; top: 0; z-index: 20; background: #FFFFFF; border-bottom: 1px solid #E3D9C4; }
.site-header-inner { max-width: 1080px; margin: 0 auto; padding: 16px 24px; display: flex; align-items: center; justify-content: space-between; }
.site-logo { font-family: 'Fraunces', serif; font-size: 22px; font-weight: 500; color: #2A2521; }
.site-header-icons { display: flex; gap: 6px; }
.icon-btn { position: relative; background: none; border: none; color: #2A2521; padding: 8px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; }
.icon-btn:hover { background: #F0E9D8; }
.badge { position: absolute; top: 0; right: 0; background: #1F6B63; color: #fff; font-size: 10px; font-weight: 600; min-width: 16px; height: 16px; border-radius: 999px; display: flex; align-items: center; justify-content: center; padding: 0 3px; }
.flash-bar { max-width: 1080px; margin: 16px auto 0; padding: 10px 24px; }
.flash-bar { background: #E4EFEC; color: #164F49; border-radius: 8px; margin: 16px 24px 0; }

/* ---------------- Hero ---------------- */
.hero { max-width: 1080px; margin: 0 auto; padding: 56px 24px; display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.hero-kicker { color: #C1603F; font-size: 14px; margin: 0 0 10px; }
.hero-title { font-family: 'Fraunces', serif; font-size: 46px; font-weight: 500; line-height: 1.08; margin: 0 0 16px; }
.hero-sub { color: #6B6255; font-size: 16px; max-width: 46ch; margin: 0; }
.hero-image-wrap { border-radius: 18px; overflow: hidden; aspect-ratio: 4/5; }
.hero-image { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------------- Placeholder image ---------------- */
.placeholder-img { background: linear-gradient(135deg, #1F6B63, #C1603F); display: flex; align-items: center; justify-content: center; }
.placeholder-img span { font-family: 'Fraunces', serif; color: #fff; font-size: 28px; }

/* ---------------- Sections ---------------- */
.section { max-width: 1080px; margin: 0 auto; padding: 8px 24px 64px; }
.section-narrow { max-width: 560px; }
.section-title { font-family: 'Fraunces', serif; font-size: 28px; font-weight: 500; margin: 0 0 24px; }
.section-title-sm { font-size: 22px; margin-bottom: 18px; }
.back-link { display: inline-block; color: #6B6255; font-size: 14px; padding: 20px 0 12px; }
.back-link:hover { color: #2A2521; }
.empty-state { padding: 60px 20px; color: #6B6255; text-align: center; }

/* ---------------- Product grid + cards ---------------- */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 20px; }
.product-card { display: block; background: #FFFFFF; border: 1px solid #E3D9C4; border-radius: 14px; overflow: hidden; transition: transform 0.15s ease, box-shadow 0.15s ease; }
.product-card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(42,37,33,0.08); }
.product-card-image-wrap { position: relative; aspect-ratio: 1/1; }
.product-card-image { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-badge { position: absolute; top: 10px; left: 10px; background: #C1603F; color: #fff; font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 999px; }
.product-card-body { padding: 14px 16px 16px; }
.product-card-title { margin: 0 0 6px; font-size: 15px; font-weight: 500; }
.product-card-price { margin: 0; font-size: 15px; color: #1F6B63; font-weight: 600; }
.price-compare { margin-left: 8px; color: #A69E8E; text-decoration: line-through; font-weight: 500; font-size: 13px; }

/* ---------------- Product detail ---------------- */
.product-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 44px; }
.product-detail-image { width: 100%; border-radius: 16px; aspect-ratio: 4/5; object-fit: cover; display: block; }
.product-detail-title { font-family: 'Fraunces', serif; font-size: 32px; font-weight: 500; margin: 0 0 10px; }
.product-detail-price { font-size: 20px; color: #1F6B63; font-weight: 600; margin: 0 0 18px; }
.product-detail-desc { color: #4A433B; margin: 0 0 24px; max-width: 52ch; }
.option-group { margin-bottom: 20px; }
.option-label { font-size: 13px; font-weight: 600; color: #6B6255; margin: 0 0 8px; }
.option-values { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; width: 0; height: 0; }
.chip span { display: inline-block; background: #fff; border: 1px solid #E3D9C4; border-radius: 8px; padding: 8px 14px; font-size: 14px; }
.chip input:checked + span { border-color: #1F6B63; background: #E4EFEC; color: #164F49; font-weight: 600; }
.detail-actions { display: flex; align-items: center; gap: 14px; margin-top: 8px; flex-wrap: wrap; }
.hint { font-size: 13px; color: #8C8375; margin-top: 10px; }
.hint-warn { color: #C1603F; }
.related-section { margin-top: 64px; }

/* ---------------- Buttons ---------------- */
.btn { display: inline-flex; align-items: center; gap: 8px; justify-content: center; border: none; border-radius: 10px; padding: 12px 22px; font-size: 15px; font-weight: 600; }
.btn-primary { background: #1F6B63; color: #fff; }
.btn-primary:hover:not(:disabled) { background: #164F49; }
.btn-primary:disabled { background: #C7CFC6; cursor: not-allowed; }
.btn-secondary { background: #fff; color: #2A2521; border: 1px solid #E3D9C4; }
.btn-secondary:hover { background: #F0E9D8; }
.btn-danger { background: #B4432C; color: #fff; }
.btn-block { width: 100%; }

/* ---------------- Quantity control ---------------- */
.qty-control { display: inline-flex; align-items: center; border: 1px solid #E3D9C4; border-radius: 10px; overflow: hidden; }
.qty-control button { background: #fff; border: none; padding: 9px 14px; font-size: 16px; }
.qty-control button:hover { background: #F0E9D8; }
.qty-input { width: 56px; border: none; text-align: center; font-weight: 600; font-size: 15px; padding: 9px 0; }
.cart-qty-form .qty-input { width: 64px; border: 1px solid #E3D9C4; border-radius: 8px; }

/* ---------------- Cart ---------------- */
.cart-list { display: flex; flex-direction: column; gap: 16px; margin-bottom: 28px; }
.cart-row { display: flex; align-items: center; gap: 14px; border: 1px solid #E3D9C4; border-radius: 12px; padding: 12px; background: #fff; }
.cart-thumb { width: 64px; height: 64px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }
.cart-row-info { flex: 1; min-width: 0; }
.cart-row-title { margin: 0 0 4px; font-weight: 500; font-size: 15px; }
.cart-row-variant { margin: 0 0 4px; font-size: 13px; color: #8C8375; }
.cart-row-price { margin: 0; font-size: 14px; color: #1F6B63; font-weight: 600; }
.cart-footer { border-top: 1px solid #E3D9C4; padding-top: 20px; }
.cart-total { display: flex; justify-content: space-between; font-size: 18px; font-weight: 600; margin-bottom: 16px; }

/* ---------------- Order summary / checkout ---------------- */
.order-summary { background: #fff; border: 1px solid #E3D9C4; border-radius: 12px; padding: 16px 18px; margin-bottom: 24px; }
.order-line { display: flex; justify-content: space-between; font-size: 14px; padding: 6px 0; color: #4A433B; }
.order-total { border-top: 1px solid #E3D9C4; margin-top: 6px; padding-top: 12px; font-weight: 700; font-size: 16px; color: #2A2521; }

/* ---------------- Forms ---------------- */
.form { display: flex; flex-direction: column; gap: 16px; margin-bottom: 20px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field label { font-size: 13px; font-weight: 600; color: #6B6255; }
.input { border: 1px solid #E3D9C4; border-radius: 9px; padding: 10px 12px; font-size: 14px; font-family: inherit; background: #fff; color: #2A2521; width: 100%; }
.input:focus { outline: 2px solid #1F6B63; outline-offset: 1px; }
.pin-input { text-align: center; letter-spacing: 4px; font-size: 20px; max-width: 200px; margin: 0 auto; }

/* ---------------- Confirmation ---------------- */
.confirmation { text-align: center; display: flex; flex-direction: column; align-items: center; padding-top: 40px; gap: 6px; }
.confirmation-icon { width: 56px; height: 56px; border-radius: 999px; background: #E4EFEC; color: #1F6B63; display: flex; align-items: center; justify-content: center; margin-bottom: 20px; font-size: 22px; }

/* ---------------- Footer ---------------- */
.site-footer { text-align: center; padding: 28px 20px; color: #8C8375; font-size: 13px; border-top: 1px solid #E3D9C4; }

/* ==================================================================
   Admin
   ================================================================== */
.admin-body { background: #F6F1E6; min-height: 100vh; }
.admin-shell { display: flex; min-height: 100vh; }
.admin-sidebar { width: 220px; background: #FFFFFF; border-right: 1px solid #E3D9C4; flex-shrink: 0; padding: 24px 0; }
.admin-sidebar-logo { font-family: 'Fraunces', serif; font-size: 19px; padding: 0 20px 20px; display: block; border-bottom: 1px solid #E3D9C4; margin-bottom: 12px; }
.admin-nav { display: flex; flex-direction: column; }
.admin-nav a { padding: 11px 20px; font-size: 14px; color: #4A433B; border-left: 3px solid transparent; }
.admin-nav a:hover { background: #F0E9D8; }
.admin-nav a.active { border-left-color: #1F6B63; background: #F0E9D8; color: #164F49; font-weight: 600; }
.admin-main { flex: 1; padding: 32px 36px; min-width: 0; }
.admin-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; flex-wrap: wrap; gap: 12px; }
.admin-page-title { font-family: 'Fraunces', serif; font-size: 24px; font-weight: 500; margin: 0; }

.admin-table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid #E3D9C4; border-radius: 10px; overflow: hidden; }
.admin-table th, .admin-table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid #E3D9C4; font-size: 14px; }
.admin-table th { background: #FBF7EF; color: #6B6255; font-weight: 600; font-size: 12px; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-thumb { width: 42px; height: 42px; border-radius: 6px; object-fit: cover; }
.row-actions { display: flex; gap: 6px; }
.row-actions a, .row-actions button { font-size: 13px; padding: 6px 10px; border-radius: 7px; }
.status-pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #E4EFEC; color: #164F49; text-transform: capitalize; }

.admin-card { background: #fff; border: 1px solid #E3D9C4; border-radius: 12px; padding: 22px; margin-bottom: 20px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin-bottom: 28px; }
.stat-card { background: #fff; border: 1px solid #E3D9C4; border-radius: 12px; padding: 18px; }
.stat-number { font-family: 'Fraunces', serif; font-size: 30px; margin: 0 0 4px; }
.stat-label { font-size: 13px; color: #6B6255; margin: 0; }

.option-row-admin { display: grid; grid-template-columns: 1fr 1.4fr auto; gap: 8px; margin-bottom: 8px; align-items: center; }
.checkbox-list { display: flex; flex-direction: column; gap: 8px; max-height: 180px; overflow-y: auto; border: 1px solid #E3D9C4; border-radius: 9px; padding: 10px 12px; }
.checkbox-row { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.current-image { width: 90px; height: 90px; object-fit: cover; border-radius: 8px; margin-bottom: 8px; display: block; }

.login-shell { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-box { background: #fff; border: 1px solid #E3D9C4; border-radius: 16px; padding: 36px; width: 100%; max-width: 380px; text-align: center; }

/* ---------------- Responsive ---------------- */
@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; padding: 32px 20px; }
  .hero-title { font-size: 34px; }
  .hero-image-wrap { order: -1; }
  .product-detail { grid-template-columns: 1fr; gap: 24px; }
  .field-row { grid-template-columns: 1fr; }
  .option-row-admin { grid-template-columns: 1fr; }
  .admin-shell { flex-direction: column; }
  .admin-sidebar { width: 100%; padding: 12px 0; }
  .admin-nav { flex-direction: row; overflow-x: auto; }
  .admin-nav a { border-left: none; border-bottom: 3px solid transparent; white-space: nowrap; }
  .admin-nav a.active { border-left-color: transparent; border-bottom-color: #1F6B63; }
  .admin-main { padding: 20px; }
}
