/* =========================================================
   Phase 2 — Public Website Styles
   ========================================================= */

/* Page hero */
.page-hero {
    background: linear-gradient(135deg, var(--surface) 0%, var(--bg) 100%);
    padding: 3.5rem 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 2rem;
}
.page-hero h1 { font-size: 2.4rem; font-weight: 800; margin-bottom: 0.5rem; }
.page-hero p  { color: var(--text-muted); font-size: 1.05rem; }

/* Breadcrumbs */
.breadcrumbs { margin-bottom: 1.5rem; font-size: 0.9rem; }
.breadcrumbs ol { display: flex; gap: 0.5rem; list-style: none; flex-wrap: wrap; padding: 0; margin: 0; }
.breadcrumbs li:not(:last-child)::after { content: '/'; margin-left: 0.5rem; color: var(--text-muted); }
.breadcrumbs a { color: var(--text-muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--primary); }
.breadcrumbs span { color: var(--text); font-weight: 600; }

/* Header search */
.header-search { display: flex; align-items: center; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.25rem 0.25rem 0.25rem 0.75rem; max-width: 260px; }
.header-search input { border: none; background: transparent; color: var(--text); outline: none; font-size: 0.9rem; width: 100%; }
.header-search button { background: var(--primary); color: white; border: none; padding: 0.4rem 0.6rem; border-radius: 8px; cursor: pointer; }

/* Shop layout */
.shop-layout { display: grid; grid-template-columns: 240px 1fr; gap: 2rem; align-items: start; }
.shop-sidebar { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; position: sticky; top: 90px; }
.shop-sidebar h3 { font-size: 1rem; margin-bottom: 1rem; }
.filter-list { list-style: none; padding: 0; margin: 0; }
.filter-list a { display: flex; justify-content: space-between; align-items: center; padding: 0.55rem 0.75rem; border-radius: 8px; color: var(--text-muted); text-decoration: none; font-size: 0.95rem; transition: all 0.2s; }
.filter-list a:hover { background: var(--bg); color: var(--text); }
.filter-list a.active { background: var(--primary); color: #fff; }
.filter-list .count { font-size: 0.75rem; opacity: 0.7; }

/* Shop toolbar */
.shop-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; flex-wrap: wrap; gap: 1rem; }
.result-count { color: var(--text-muted); font-size: 0.95rem; }
.sort-form { display: flex; align-items: center; gap: 0.5rem; font-size: 0.9rem; }
.sort-form select { background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: 0.45rem 0.75rem; font-size: 0.9rem; }

/* Product grid + card */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1.5rem; margin-bottom: 2rem; }

.product-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
}
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--primary); }

.product-card-media { position: relative; display: block; aspect-ratio: 4/3; background: var(--bg); overflow: hidden; }
.product-card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s; }
.product-card:hover .product-card-media img { transform: scale(1.05); }
.product-card-placeholder { display: flex; align-items: center; justify-content: center; font-size: 3rem; width: 100%; height: 100%; color: var(--text-muted); }

.product-card-media .badge { position: absolute; top: 10px; left: 10px; font-size: 0.7rem; padding: 0.25rem 0.55rem; border-radius: 999px; font-weight: 600; }
.badge-success { background: #10b981; color: #fff; }
.badge-danger  { background: #ef4444; color: #fff; }
.badge-featured { background: linear-gradient(135deg, #6366f1, #a855f7); color: #fff; top: 10px; right: 10px; left: auto; }

.product-card-body { padding: 1rem 1.1rem 1.2rem; display: flex; flex-direction: column; gap: 0.4rem; flex: 1; }
.product-card-category { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--primary); font-weight: 700; }
.product-card-title { font-size: 1rem; margin: 0; }
.product-card-title a { color: var(--text); text-decoration: none; }
.product-card-title a:hover { color: var(--primary); }
.product-card-desc { font-size: 0.85rem; color: var(--text-muted); margin: 0; flex: 1; }
.product-card-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 0.5rem; }
.product-card-price { display: flex; flex-direction: column; line-height: 1.1; }
.product-card-price .currency { font-size: 0.7rem; color: var(--text-muted); }
.product-card-price .amount { font-weight: 800; font-size: 1.05rem; }
.btn-sm { padding: 0.4rem 0.85rem; font-size: 0.85rem; }
.btn-disabled { background: var(--border); color: var(--text-muted); cursor: not-allowed; }

/* Pagination */
.pagination { display: flex; justify-content: center; align-items: center; gap: 0.35rem; flex-wrap: wrap; margin: 2rem 0; }
.page-btn { min-width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; padding: 0 0.75rem; border-radius: 8px; background: var(--surface); border: 1px solid var(--border); color: var(--text); text-decoration: none; font-size: 0.9rem; transition: all 0.2s; }
.page-btn:hover { border-color: var(--primary); color: var(--primary); }
.page-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 700; }
.page-btn.disabled { opacity: 0.4; cursor: not-allowed; }
.page-ellipsis { padding: 0 0.4rem; color: var(--text-muted); }

/* Product detail */
.product-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; margin: 2rem 0 3rem; }
.product-gallery .product-main-image { aspect-ratio: 1; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; display: flex; align-items: center; justify-content: center; }
.product-main-image img { width: 100%; height: 100%; object-fit: cover; }
.product-thumbs { display: flex; gap: 0.5rem; margin-top: 0.75rem; }
.product-thumbs img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); cursor: pointer; }

.product-info h1 { font-size: 1.9rem; margin: 0.5rem 0 1rem; }
.product-category-tag { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--primary); font-weight: 700; }
.product-price-block { display: flex; align-items: baseline; gap: 0.5rem; margin-bottom: 1rem; }
.product-price-block .currency { font-size: 0.9rem; color: var(--text-muted); }
.product-price-block .amount { font-size: 2rem; font-weight: 800; }
.price-compare { color: var(--text-muted); text-decoration: line-through; font-size: 1rem; }

.product-availability { display: inline-block; font-size: 0.9rem; font-weight: 600; padding: 0.35rem 0.75rem; border-radius: 999px; margin-bottom: 1rem; }
.product-availability.in-stock { background: rgba(16,185,129,0.12); color: #059669; }
.product-availability.out-stock { background: rgba(239,68,68,0.12); color: #dc2626; }

.product-short { color: var(--text-muted); margin-bottom: 1.25rem; }
.product-warning { background: rgba(245,158,11,0.1); border-left: 4px solid #f59e0b; padding: 0.75rem 1rem; border-radius: 8px; margin-bottom: 1.25rem; font-size: 0.9rem; }

.product-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: center; margin-bottom: 1rem; }
.qty-label { display: flex; align-items: center; gap: 0.5rem; font-size: 0.9rem; color: var(--text-muted); }
.qty-label input { width: 70px; padding: 0.6rem; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); }

.product-trust { display: flex; gap: 1rem; flex-wrap: wrap; font-size: 0.85rem; color: var(--text-muted); margin: 1rem 0 1.5rem; }

.product-attrs table { width: 100%; border-collapse: collapse; margin-top: 0.5rem; }
.product-attrs th, .product-attrs td { text-align: left; padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
.product-attrs th { color: var(--text-muted); font-weight: 500; width: 40%; }

.product-description { margin-top: 3rem; }
.product-description h2 { margin-bottom: 1rem; }
.rich-text { color: var(--text-muted); line-height: 1.75; }

.policy-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; margin-top: 2rem; }
.policy-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; }
.policy-card h4 { margin: 0 0 0.5rem; font-size: 0.95rem; }
.policy-card p  { margin: 0; font-size: 0.9rem; color: var(--text-muted); }

.related-products { margin: 4rem 0; }

/* Empty state */
.empty-state { text-align: center; padding: 4rem 1rem; background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius); margin: 2rem 0; }
.empty-icon { font-size: 3rem; margin-bottom: 1rem; }
.empty-state h3 { margin-bottom: 0.5rem; }
.empty-state p  { color: var(--text-muted); margin-bottom: 1.5rem; }

/* FAQ */
.faq-list { max-width: 800px; margin: 0 auto 4rem; }
.faq-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.25rem; margin-bottom: 0.75rem; }
.faq-item summary { cursor: pointer; font-weight: 600; }
.faq-item p { margin: 0.75rem 0 0; color: var(--text-muted); }

/* Contact */
.contact-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 3rem; margin-bottom: 4rem; }
.contact-info { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; height: fit-content; }
.contact-info h3 { margin-top: 0; }
.contact-info p { font-size: 0.95rem; margin-bottom: 1rem; }

/* Forms */
.form label { display: block; margin-bottom: 1rem; font-size: 0.9rem; font-weight: 500; }
.form input, .form textarea { display: block; width: 100%; margin-top: 0.35rem; padding: 0.7rem 0.9rem; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font-family: inherit; font-size: 0.95rem; }
.form input:focus, .form textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99,102,241,0.15); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/* Alerts */
.alert { padding: 0.9rem 1.1rem; border-radius: 8px; margin-bottom: 1.25rem; font-size: 0.9rem; }
.alert-success { background: rgba(16,185,129,0.12); color: #065f46; border: 1px solid rgba(16,185,129,0.3); }
.alert-error   { background: rgba(239,68,68,0.12); color: #991b1b; border: 1px solid rgba(239,68,68,0.3); }
.alert ul { margin: 0; padding-left: 1.2rem; }

/* Prose (static pages) */
.prose { max-width: 800px; margin: 0 auto 4rem; line-height: 1.8; }
.prose h2 { margin: 2rem 0 0.75rem; font-size: 1.35rem; }
.prose p, .prose li { color: var(--text-muted); }
.prose a { color: var(--primary); }

/* Responsive */
@media (max-width: 900px) {
    .shop-layout { grid-template-columns: 1fr; }
    .shop-sidebar { position: static; }
    .product-detail { grid-template-columns: 1fr; gap: 2rem; }
    .contact-grid { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .header-search { display: none; }
    .page-hero h1 { font-size: 1.8rem; }
    .product-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 1rem; }
    .product-card-body { padding: 0.75rem; }
    .product-card-price .amount { font-size: 0.95rem; }
}