/*
Theme Name: Farmacia Mirra
Theme URI: https://shop.farmaciamirra.it
Author: Farmacia Mirra
Description: Tema custom per lo shop online di Farmacia Mirra, Nocera Inferiore (SA).
Version: 1.0
Text Domain: farmacia-mirra
Requires PHP: 7.4
*/

:root {
    --navy: #0d2137;
    --navy-light: #17324f;
    --teal: #00707a;
    --teal-light: #00949f;
    --gold: #c4a24a;
    --gold-light: #d9bc6f;
    --cream: #f7f4ee;
    --white: #ffffff;
    --ink: #1c2b3a;
    --gray: #6b7a8d;
    --border: #e3ddd0;
    --radius: 12px;
    --shadow-sm: 0 1px 3px rgba(13,33,55,0.08);
    --shadow-md: 0 8px 24px rgba(13,33,55,0.10);
    --shadow-lg: 0 16px 40px rgba(13,33,55,0.14);
    --font-head: 'Fraunces', Georgia, serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font-body);
    color: var(--ink);
    background: var(--cream);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--teal); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--teal-light); }

h1, h2, h3, h4 {
    font-family: var(--font-head);
    color: var(--navy);
    line-height: 1.2;
    margin: 0 0 0.5em;
    font-weight: 600;
}

.container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ---------- Top bar ---------- */
.top-bar { background: var(--gold); color: var(--navy); font-size: 0.78rem; }
.top-bar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 0;
}
.top-bar span { display: flex; align-items: center; gap: 6px; }
.top-bar svg { width: 14px; height: 14px; }
.top-bar a { color: var(--navy); font-weight: 600; }
@media (max-width: 600px) {
    .top-bar-inner span:first-child { display: none; }
    .top-bar-inner { justify-content: center; }
}

/* ---------- Category menu ---------- */
.category-menu { list-style: none; display: flex; gap: 4px; margin: 0; padding: 10px 0; flex-wrap: wrap; }
.category-menu > li { position: relative; }
.category-menu > li > a {
    display: block;
    color: rgba(255,255,255,0.9);
    font-size: 0.85rem;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: 999px;
}
.category-menu > li > a:hover, .category-menu > li.has-children:hover > a { background: rgba(255,255,255,0.12); color: var(--gold-light); }
.category-menu .sub-menu {
    list-style: none;
    margin: 0; padding: 10px 0;
    position: absolute;
    top: 100%; left: 0;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
    min-width: 220px;
    display: none;
    z-index: 50;
}
.category-menu > li.has-children:hover .sub-menu { display: block; }
.category-menu .sub-menu a { display: block; padding: 8px 18px; color: var(--ink); font-size: 0.85rem; }
.category-menu .sub-menu a:hover { background: var(--cream); color: var(--teal); }

@media (max-width: 860px) {
    .category-menu { flex-direction: column; gap: 0; }
    .category-menu .sub-menu { position: static; display: block; box-shadow: none; border: none; border-left: 2px solid var(--gold); margin-left: 14px; }
    .category-menu > li > a { color: rgba(255,255,255,0.85); }
}

/* ---------- Header ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 200;
    background: var(--navy);
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 14px 0;
}
.site-logo-link {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}
.site-logo-mark {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--teal-light), var(--navy));
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.site-logo-mark svg { width: 24px; height: 24px; }
.site-logo-text { display: flex; flex-direction: column; line-height: 1.15; }
.site-logo-text strong { font-family: var(--font-head); color: var(--white); font-size: 1.25rem; font-weight: 600; }
.site-logo-text span { color: var(--gold-light); font-size: 0.68rem; letter-spacing: 2px; text-transform: uppercase; }

.header-search { flex: 1; max-width: 440px; }
.header-search form { display: flex; }
.header-search input[type="search"] {
    flex: 1;
    border: 1px solid transparent;
    background: rgba(255,255,255,0.94);
    border-radius: 999px 0 0 999px;
    padding: 10px 18px;
    font-family: var(--font-body);
    font-size: 0.92rem;
    outline: none;
}
.header-search button {
    background: var(--gold);
    border: none;
    color: var(--navy);
    border-radius: 0 999px 999px 0;
    padding: 0 20px;
    font-weight: 600;
    cursor: pointer;
}
.header-search button:hover { background: var(--gold-light); }

.header-actions { display: flex; align-items: center; gap: 18px; flex-shrink: 0; }
.header-actions a { color: var(--white); display: flex; align-items: center; gap: 6px; font-size: 0.88rem; }
.header-actions a:hover { color: var(--gold-light); }
.cart-count {
    background: var(--gold);
    color: var(--navy);
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 1px 7px;
}
.menu-toggle {
    display: none;
    background: none;
    border: 1px solid rgba(255,255,255,0.3);
    color: var(--white);
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
}

.main-nav { background: var(--navy-light); }
.main-nav ul {
    list-style: none;
    display: flex;
    gap: 28px;
    margin: 0;
    padding: 10px 0;
}
.main-nav a {
    color: rgba(255,255,255,0.88);
    font-size: 0.88rem;
    font-weight: 500;
    letter-spacing: 0.3px;
}
.main-nav a:hover { color: var(--gold-light); }

@media (max-width: 860px) {
    .header-search { display: none; }
    .menu-toggle { display: inline-flex; }
    .main-nav { display: none; }
    .main-nav.is-open { display: block; }
    .main-nav ul { flex-direction: column; gap: 4px; padding: 12px 0; }
}

/* ---------- Hero ---------- */
.hero {
    background: linear-gradient(120deg, var(--navy) 0%, var(--teal) 130%);
    position: relative;
    overflow: hidden;
}
.hero::after {
    content: "";
    position: absolute;
    right: -80px;
    top: -80px;
    width: 360px;
    height: 360px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(196,162,74,0.28), transparent 70%);
}
.hero-inner {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    align-items: center;
    gap: 40px;
    padding: 64px 0;
    position: relative;
}
.hero-eyebrow {
    color: var(--gold-light);
    font-size: 0.78rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 14px;
    display: block;
}
.hero h1 {
    color: var(--white);
    font-size: 2.6rem;
    margin-bottom: 18px;
}
.hero p {
    color: rgba(255,255,255,0.82);
    font-size: 1.08rem;
    max-width: 480px;
    margin-bottom: 28px;
}
.hero-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 30px; }
.hero-badges span {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: var(--white);
    font-size: 0.8rem;
    padding: 7px 16px;
    border-radius: 999px;
}
.hero-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--gold);
    color: var(--navy);
    font-weight: 700;
    padding: 13px 28px;
    border-radius: 999px;
    box-shadow: var(--shadow-md);
}
.hero-cta:hover { background: var(--gold-light); color: var(--navy); }
.hero-visual {
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 20px;
    aspect-ratio: 4/3;
    display: flex;
    align-items: center;
    justify-content: center;
}
.hero-visual svg { width: 55%; opacity: 0.9; }

@media (max-width: 860px) {
    .hero-inner { grid-template-columns: 1fr; padding: 40px 0; }
    .hero h1 { font-size: 1.9rem; }
    .hero-visual { display: none; }
}

/* ---------- Trust strip ---------- */
.trust-strip {
    background: var(--white);
    border-bottom: 1px solid var(--border);
}
.trust-strip-inner {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    padding: 26px 0;
}
.trust-item { display: flex; align-items: center; gap: 12px; }
.trust-item .ico {
    width: 40px; height: 40px; border-radius: 10px;
    background: var(--cream);
    display: flex; align-items: center; justify-content: center;
    color: var(--teal);
    flex-shrink: 0;
}
.trust-item strong { display: block; font-size: 0.88rem; color: var(--navy); }
.trust-item small { color: var(--gray); font-size: 0.78rem; }

@media (max-width: 860px) {
    .trust-strip-inner { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Section titles ---------- */
.section { padding: 56px 0; }
.section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 28px;
}
.section-head h2 { font-size: 1.7rem; margin: 0; }
.section-head a { font-size: 0.86rem; font-weight: 600; }

/* ---------- Product grid (WooCommerce overrides) ---------- */
ul.products {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 24px !important;
    list-style: none;
    margin: 0 !important;
    padding: 0 !important;
}
@media (max-width: 1000px) { ul.products { grid-template-columns: repeat(3, 1fr) !important; } }
@media (max-width: 700px) { ul.products { grid-template-columns: repeat(2, 1fr) !important; } }
@media (max-width: 460px) { ul.products { grid-template-columns: 1fr !important; } }

ul.products li.product {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: box-shadow .2s ease, transform .2s ease;
    position: relative;
    width: 100% !important;
    float: none !important;
    margin: 0 !important;
    display: block !important;
}
ul.products li.product:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); }
ul.products li.product a.woocommerce-LoopProduct-link { display: block; }
ul.products li.product img {
    aspect-ratio: 1/1;
    object-fit: contain;
    background: var(--white);
    padding: 18px;
    width: 100% !important;
    height: auto !important;
    max-width: none !important;
}
ul.products li.product .woocommerce-loop-product__title {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--navy);
    padding: 0 16px;
    margin: 6px 0 2px;
    min-height: 2.6em;
}
.nl-signup {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 22px 0;
    border-bottom: 1px solid rgba(255,255,255,0.12);
}
.nl-signup-text { display: flex; flex-direction: column; gap: 2px; color: var(--white); }
.nl-signup-text strong { font-family: var(--font-heading); font-size: 1.05rem; }
.nl-signup-text span { font-size: 0.85rem; color: rgba(255,255,255,0.7); }
.nl-signup-form { display: flex; gap: 8px; flex-wrap: wrap; }
.nl-signup-form input[type="email"] {
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.25);
    background: rgba(255,255,255,0.08);
    color: var(--white);
    min-width: 220px;
}
.nl-signup-form input[type="email"]::placeholder { color: rgba(255,255,255,0.55); }
.nl-signup-form button {
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    background: var(--gold);
    color: var(--navy);
    font-weight: 700;
    cursor: pointer;
}
.nl-signup-form button:hover { background: var(--gold-light); }
.nl-signup .nl-hp { position: absolute; left: -9999px; }
.nl-signup-msg { flex-basis: 100%; margin: 4px 0 0; font-size: 0.82rem; }
.nl-signup-msg.nl-ok { color: var(--gold-light); }
.nl-signup-msg.nl-err { color: #e08080; }
.footer-legal {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
    padding: 16px 0;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 0.82rem;
}
.footer-legal a { color: rgba(255,255,255,0.65); text-decoration: none; }
.footer-legal a:hover { color: var(--gold-light); text-decoration: underline; }
.footer-legal-sep { color: rgba(255,255,255,0.3); }
.footer-dedica {
    font-family: var(--font-heading);
    font-style: italic;
    font-weight: 600;
    color: var(--gold-light);
    letter-spacing: 0.02em;
}
.wa-float-btn {
    position: fixed;
    right: 22px;
    bottom: 22px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #25D366;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 18px rgba(0,0,0,0.25);
    z-index: 999;
    transition: transform .15s ease, box-shadow .15s ease;
}
.wa-float-btn:hover { transform: scale(1.08); box-shadow: 0 8px 22px rgba(0,0,0,0.3); color: #fff; }
@media (max-width: 600px) {
    .wa-float-btn { right: 14px; bottom: 14px; width: 50px; height: 50px; }
}
ul.products li.product .star-rating {
    margin: 2px 16px 0;
    font-size: 0.85rem;
    width: 5.3em;
}
ul.products li.product .star-rating span:before,
.woocommerce div.product .woocommerce-tabs .star-rating span:before,
.woocommerce div.product p.stars a:before { color: var(--gold); }
ul.products li.product .star-rating:before { color: var(--border); }
ul.products li.product .price {
    padding: 0 16px 16px;
    color: var(--teal) !important;
    font-weight: 700;
    font-size: 1.02rem;
}
ul.products li.product .price del { color: var(--gray); font-weight: 400; opacity: 0.7; }
ul.products li.product .price ins { text-decoration: none; }
ul.products li.product .button,
ul.products li.product a.added_to_cart {
    display: block;
    margin: 0 16px 16px;
    background: var(--navy);
    color: var(--white) !important;
    text-align: center;
    padding: 10px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
}
ul.products li.product .button:hover { background: var(--teal); }
ul.products li.product .onsale {
    position: absolute;
    top: 12px; left: 12px;
    background: var(--gold);
    color: var(--navy);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 999px;
    min-height: 0; min-width: 0; line-height: 1;
}

/* Search / sorting bar on shop page */
.woocommerce-ordering select,
.search-field {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 9px 14px;
    background: var(--white);
    font-family: var(--font-body);
}
.woocommerce-result-count { color: var(--gray); font-size: 0.88rem; }

.woocommerce-pagination ul { display: flex; gap: 6px; list-style: none; padding: 0; }
.woocommerce-pagination a, .woocommerce-pagination span {
    display: flex; align-items: center; justify-content: center;
    width: 36px; height: 36px;
    border-radius: 8px;
    border: 1px solid var(--border);
    color: var(--navy);
    font-size: 0.85rem;
}
.woocommerce-pagination .current { background: var(--navy); color: var(--white); border-color: var(--navy); }

/* Buttons general (cart, checkout, single product) */
.button, button.button, input.button, .woocommerce a.button,
.woocommerce button.button, .woocommerce #respond input#submit,
.woocommerce input.button.alt {
    background: var(--navy) !important;
    color: var(--white) !important;
    border-radius: 999px !important;
    border: none !important;
    padding: 12px 26px !important;
    font-weight: 600 !important;
    font-family: var(--font-body) !important;
    cursor: pointer;
}
.button:hover, button.button:hover, .woocommerce a.button:hover { background: var(--teal) !important; }

/* Single product */
.woocommerce div.product div.images img { border-radius: var(--radius); border: 1px solid var(--border); }
.woocommerce div.product p.price, .woocommerce div.product span.price { color: var(--teal); font-size: 1.4rem; font-weight: 700; }
.woocommerce div.product .product_title { font-size: 1.9rem; }

/* Cart / checkout tables */
table.shop_table, .woocommerce-cart-form, #order_review {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--white);
}
table.shop_table th { background: var(--cream); color: var(--navy); font-weight: 700; }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy); color: rgba(255,255,255,0.78); margin-top: 60px; }
.footer-grid {
    display: grid;
    grid-template-columns: 1.3fr 1fr 1fr 1fr;
    gap: 32px;
    padding: 52px 0 32px;
}
.footer-col h4 { color: var(--white); font-size: 0.95rem; margin-bottom: 14px; }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: 8px; }
.footer-col a { color: rgba(255,255,255,0.72); font-size: 0.88rem; }
.footer-col a:hover { color: var(--gold-light); }
.footer-col p { font-size: 0.85rem; color: rgba(255,255,255,0.65); }
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 18px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.78rem;
    color: rgba(255,255,255,0.55);
    flex-wrap: wrap;
    gap: 12px;
}
.ministero-badge img { height: 40px; }

@media (max-width: 860px) {
    .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 500px) {
    .footer-grid { grid-template-columns: 1fr; }
}

/* Sidebar (shop filters) */
.shop-layout { display: grid; grid-template-columns: 240px 1fr; gap: 32px; align-items: start; }
.shop-sidebar .widget { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; margin-bottom: 20px; }
.shop-sidebar .widget h3 { font-size: 0.9rem; margin-bottom: 10px; }
@media (max-width: 900px) { .shop-layout { grid-template-columns: 1fr; } }

.page-title { padding: 36px 0 10px; }
.page-title h1 { font-size: 1.9rem; margin: 0; }
