/* =========================================================
   Panacean - Public Site Stylesheet
   ========================================================= */

:root {
    --primary: #0f7a5c;
    --primary-dark: #0b5c45;
    --accent: #1ea672;
    --whatsapp: #25D366;
    --text-dark: #1c2b28;
    --text-muted: #667873;
    --bg-light: #f6f9f8;
    --border-color: #e2e8e6;
    --white: #ffffff;
    --radius: 8px;
    --shadow: 0 2px 10px rgba(0,0,0,0.06);
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-dark);
    background: var(--white);
    line-height: 1.6;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4 { margin: 0 0 12px; line-height: 1.3; }

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.section { padding: 50px 0; }
.section-alt { background: var(--bg-light); }
.section-title { text-align: center; font-size: 28px; margin-bottom: 30px; color: var(--primary-dark); }

.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all .2s ease;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline { background: transparent; border: 2px solid var(--primary); color: var(--primary); margin-left: 10px; }
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-whatsapp { background: var(--whatsapp); color: #fff; }
.btn-whatsapp:hover { background: #1ea952; }
.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn-lg { padding: 16px 30px; font-size: 16px; }
.btn-link { background: none; border: none; color: var(--primary); cursor: pointer; text-decoration: underline; padding: 0; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------- Header ---------- */
.site-header { background: #fff; box-shadow: var(--shadow); position: sticky; top: 0; z-index: 100; }
.topbar { background: var(--primary-dark); color: #fff; font-size: 13px; }
.topbar-inner { display: flex; gap: 20px; padding: 6px 0; }

.main-nav { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; flex-wrap: wrap; }
.logo img { max-height: 50px; }
.logo-text { font-size: 24px; font-weight: 700; color: var(--primary); }

.nav-toggle { display: none; background: none; border: none; font-size: 26px; cursor: pointer; }

.main-menu ul { display: flex; gap: 24px; align-items: center; }
.main-menu a { font-weight: 600; color: var(--text-dark); }
.main-menu a:hover { color: var(--primary); }
.has-dropdown { position: relative; }
.dropdown {
    display: none;
    position: absolute;
    top: 100%; left: 0;
    background: #fff;
    box-shadow: var(--shadow);
    min-width: 220px;
    border-radius: var(--radius);
    overflow: hidden;
    z-index: 10;
}
.has-dropdown:hover .dropdown { display: block; }
.dropdown li a { display: block; padding: 10px 16px; font-weight: 400; }
.dropdown li a:hover { background: var(--bg-light); }

.nav-actions { display: flex; align-items: center; gap: 16px; }
.search-form { display: flex; }
.search-form input { padding: 8px 10px; border: 1px solid var(--border-color); border-radius: var(--radius) 0 0 var(--radius); }
.search-form button { border: 1px solid var(--border-color); border-left: none; background: var(--bg-light); border-radius: 0 var(--radius) var(--radius) 0; cursor: pointer; padding: 0 12px; }
.cart-link { font-weight: 600; position: relative; }
.cart-count { background: var(--primary); color: #fff; border-radius: 50%; padding: 1px 7px; font-size: 12px; margin-left: 4px; }

/* ---------- WhatsApp floating toggle ---------- */
.whatsapp-toggle {
    position: fixed;
    left: 20px;
    bottom: 20px;
    background: var(--whatsapp);
    width: 58px; height: 58px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 14px rgba(0,0,0,0.25);
    z-index: 999;
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(37,211,102,0.5); }
    70% { box-shadow: 0 0 0 14px rgba(37,211,102,0); }
    100% { box-shadow: 0 0 0 0 rgba(37,211,102,0); }
}

/* ---------- Hero ---------- */
.hero {
    background: linear-gradient(120deg, var(--primary-dark), var(--primary));
    color: #fff;
    padding: 80px 0;
}
.hero-text h1 { font-size: 38px; max-width: 700px; }
.hero-text p { font-size: 18px; opacity: .9; margin-bottom: 24px; }
.hero .btn-outline { border-color: #fff; color: #fff; }
.hero .btn-outline:hover { background: #fff; color: var(--primary-dark); }

/* ---------- Category grid ---------- */
.category-grid, .product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}
.category-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
    text-align: center;
    box-shadow: var(--shadow);
    transition: transform .2s ease;
}
.category-card:hover { transform: translateY(-4px); }
.category-card-img { height: 150px; overflow: hidden; background: var(--bg-light); }
.category-card-img img { width: 100%; height: 100%; object-fit: cover; }
.category-card h3 { padding: 14px 10px 4px; font-size: 17px; color: var(--primary-dark); }
.category-card p { padding: 0 14px 14px; font-size: 14px; color: var(--text-muted); }

.img-placeholder { width: 100%; height: 100%; background: repeating-linear-gradient(45deg,#eee,#eee 10px,#f7f7f7 10px,#f7f7f7 20px); }
.img-placeholder.large { min-height: 350px; }

/* ---------- Product card ---------- */
.product-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
}
.product-card-img { position: relative; height: 180px; background: var(--bg-light); overflow: hidden; }
.product-card-img img { width: 100%; height: 100%; object-fit: cover; }
.badge { position: absolute; top: 10px; right: 10px; background: #c0392b; color: #fff; font-size: 11px; padding: 3px 8px; border-radius: 4px; }
.product-card-body { padding: 14px; flex: 1; display: flex; flex-direction: column; }
.product-category { font-size: 11px; text-transform: uppercase; color: var(--accent); font-weight: 700; }
.product-card-body h3 { font-size: 16px; margin: 6px 0; }
.price { font-weight: 700; color: var(--primary-dark); font-size: 16px; margin-bottom: 10px; }
.price .unit, .price-large .unit { font-weight: 400; color: var(--text-muted); font-size: 13px; }

.add-to-cart-form { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.qty-control { display: flex; align-items: center; border: 1px solid var(--border-color); border-radius: var(--radius); overflow: hidden; width: fit-content; }
.qty-btn { background: var(--bg-light); border: none; width: 32px; height: 32px; cursor: pointer; font-size: 16px; }
.qty-input { width: 60px; border: none; text-align: center; padding: 6px 0; }
.qty-input::-webkit-outer-spin-button, .qty-input::-webkit-inner-spin-button { opacity: 1; }

/* ---------- Page banner ---------- */
.page-banner {
    background: var(--bg-light) center/cover no-repeat;
    padding: 50px 0;
    border-bottom: 1px solid var(--border-color);
}
.page-banner h1 { color: var(--primary-dark); }

/* ---------- Breadcrumb ---------- */
.breadcrumb { font-size: 14px; color: var(--text-muted); margin-bottom: 20px; }
.breadcrumb a { color: var(--primary); }

/* ---------- Product detail ---------- */
.product-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-bottom: 40px; }
.main-image { border: 1px solid var(--border-color); border-radius: var(--radius); overflow: hidden; }
.main-image img { width: 100%; }
.thumb-list { display: flex; gap: 10px; margin-top: 10px; }
.thumb { width: 70px; height: 70px; object-fit: cover; border-radius: 6px; border: 2px solid var(--border-color); cursor: pointer; }
.thumb.active { border-color: var(--primary); }
.product-info .sku { color: var(--text-muted); font-size: 13px; }
.price-large { font-size: 28px; font-weight: 700; color: var(--primary-dark); }
.stock { font-weight: 600; }
.stock.in_stock { color: var(--accent); }
.stock.out_of_stock { color: #c0392b; }
.short-desc { color: var(--text-muted); margin: 14px 0; }
.product-page-form label { font-weight: 600; display: block; margin-bottom: 6px; }
.product-actions { display: flex; gap: 12px; margin-top: 16px; flex-wrap: wrap; }
.meta-line { margin-top: 20px; font-size: 14px; }
.product-full-description { margin-top: 40px; border-top: 1px solid var(--border-color); padding-top: 30px; }

/* ---------- Products listing layout ---------- */
.products-layout { display: grid; grid-template-columns: 240px 1fr; gap: 30px; }
.products-sidebar h3 { font-size: 16px; }
.filter-list li a { display: block; padding: 8px 0; color: var(--text-dark); border-bottom: 1px solid var(--border-color); }
.filter-list li.active a { color: var(--primary); font-weight: 700; }
.products-toolbar { margin-bottom: 16px; color: var(--text-muted); font-size: 14px; }

/* ---------- Pagination ---------- */
.pagination { margin-top: 30px; }
.pagination ul { display: flex; gap: 8px; justify-content: center; }
.pagination li a { display: block; padding: 8px 14px; border: 1px solid var(--border-color); border-radius: var(--radius); }
.pagination li.active a { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ---------- Cart ---------- */
.cart-table { width: 100%; border-collapse: collapse; margin-bottom: 20px; }
.cart-table th, .cart-table td { padding: 12px; border-bottom: 1px solid var(--border-color); text-align: left; vertical-align: middle; }
.cart-product-cell { display: flex; align-items: center; gap: 12px; }
.cart-product-cell img { width: 55px; height: 55px; object-fit: cover; border-radius: 6px; }
.cart-actions { margin-bottom: 30px; }
.cart-summary { text-align: right; padding: 20px; background: var(--bg-light); border-radius: var(--radius); }
.cart-summary h3 { color: var(--primary-dark); }
.clear-cart-form { text-align: right; }

/* ---------- Contact ---------- */
.contact-layout { display: grid; grid-template-columns: 1fr 1.4fr; gap: 40px; }
.contact-details { margin: 20px 0; }
.contact-details li { padding: 6px 0; }
.contact-form .form-row { margin-bottom: 16px; }
.contact-form label { display: block; font-weight: 600; margin-bottom: 6px; }
.contact-form input, .contact-form textarea {
    width: 100%; padding: 10px 12px; border: 1px solid var(--border-color); border-radius: var(--radius); font-family: inherit;
}
.alert { padding: 14px 18px; border-radius: var(--radius); margin-bottom: 20px; }
.alert-success { background: #e5f7ee; color: #0f7a5c; border: 1px solid #b9e8cf; }
.alert-error { background: #fdecea; color: #c0392b; border: 1px solid #f5c6c0; }

/* ---------- Trust strip ---------- */
.trust-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; text-align: center; }
.trust-grid h3 { color: var(--primary-dark); }
.trust-grid p { color: var(--text-muted); }

/* ---------- Footer ---------- */
.site-footer { background: var(--text-dark); color: #cfd8d5; margin-top: 60px; }
.footer-inner { display: grid; grid-template-columns: repeat(4, 1fr); gap: 30px; padding: 50px 0 30px; }
.footer-col h4 { color: #fff; margin-bottom: 14px; }
.footer-col ul li { padding: 4px 0; }
.footer-col a:hover { color: var(--accent); }
.social-links { display: flex; gap: 12px; flex-wrap: wrap; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); padding: 16px 0; text-align: center; font-size: 13px; }

/* ---------- Content pages ---------- */
.content-page { max-width: 900px; margin: 0 auto; }
.content-page img { border-radius: var(--radius); margin: 20px 0; }

/* ---------- Responsive ---------- */
@media (max-width: 992px) {
    .category-grid, .product-grid { grid-template-columns: repeat(2, 1fr); }
    .product-detail, .products-layout, .contact-layout { grid-template-columns: 1fr; }
    .footer-inner { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
    .nav-toggle { display: block; }
    .main-menu { display: none; width: 100%; }
    .main-menu.open { display: block; }
    .main-menu ul { flex-direction: column; align-items: flex-start; gap: 0; }
    .dropdown { position: static; box-shadow: none; display: block; }
    .category-grid, .product-grid { grid-template-columns: 1fr; }
    .nav-actions { width: 100%; justify-content: space-between; margin-top: 10px; }
    .trust-grid { grid-template-columns: 1fr; }
    .footer-inner { grid-template-columns: 1fr; }
}