/*
 * Farmacia Mirra — restyle fase 2 (6 ottobre 2026)
 * Home, scheda prodotto, carrello, cassa e account: SOLO stile, layout, responsive, accessibilità.
 * Caricato dopo restyle.css (fase 1, invariato). Nessun colore nuovo (navy / teal / oro / crema del tema).
 * Non nasconde né sposta contenuti, link, loghi, contatti, WhatsApp, footer o elementi legali e non tocca
 * la logica di carrello, cassa e pagamenti: i blocchi WooCommerce ricevono solo regole di aspetto.
 */

:root {
    --fm-danger: #b3261e;
    --fm-ring: 0 0 0 3px rgba(0, 112, 122, 0.25);
}

/* =====================================================================
   Comune: titoli di pagina, avvisi, campi modulo
   ===================================================================== */
body.woocommerce-cart .section,
body.woocommerce-checkout .section,
body.woocommerce-account .section { padding-top: 28px; padding-bottom: 40px; }

body.woocommerce-cart article > h1,
body.woocommerce-checkout article > h1,
body.woocommerce-account article > h1 {
    font-size: clamp(1.6rem, 1.25rem + 1.4vw, 2.1rem);
    margin: 0 0 22px;
}
body.woocommerce-cart article > h1::after,
body.woocommerce-checkout article > h1::after,
body.woocommerce-account article > h1::after {
    content: ""; display: block; width: 48px; height: 3px; margin-top: 10px;
    background: var(--gold); border-radius: 2px;
}

.woocommerce-message, .woocommerce-info, .woocommerce-error {
    list-style: none; margin: 0 0 18px; padding: 14px 18px 14px 20px;
    background: var(--white); color: var(--ink);
    border: 1px solid var(--border); border-left: 4px solid var(--teal); border-radius: 10px;
    box-shadow: var(--shadow-sm);
}
.woocommerce-message::before, .woocommerce-info::before, .woocommerce-error::before { display: none; }
.woocommerce-info { border-left-color: var(--gold); }
.woocommerce-error { border-left-color: var(--fm-danger); }
.woocommerce-message a.button, .woocommerce-info a.button { float: none; margin-right: 12px; }

:is(body.woocommerce-account article, body.single-product .site-main)
:is(input[type="text"], input[type="email"], input[type="tel"], input[type="password"], input[type="number"], input[type="url"], textarea, select) {
    width: 100%; min-height: 48px; padding: 10px 14px;
    background: var(--white); color: var(--ink);
    border: 1px solid #c9c2b2; border-radius: 10px;
    font-family: var(--font-body); font-size: 16px; line-height: 1.4;
}
:is(body.woocommerce-account article, body.single-product .site-main) textarea { min-height: 120px; }
:is(body.woocommerce-account article, body.single-product .site-main)
:is(input, textarea, select):focus { outline: none; border-color: var(--teal); box-shadow: var(--fm-ring); }
:is(body.woocommerce-account article, body.single-product .site-main) label {
    display: block; margin-bottom: 6px; font-size: 0.9rem; font-weight: 600; color: var(--navy);
}
:is(body.woocommerce-account article, body.single-product .site-main) label .required { color: var(--fm-danger); text-decoration: none; }
:is(body.woocommerce-account article, body.single-product .site-main) input[type="checkbox"] {
    width: 18px; height: 18px; min-height: 0; margin-right: 8px; accent-color: var(--teal); vertical-align: -3px;
}

/* =====================================================================
   Home
   ===================================================================== */
.home .hero-inner { padding-top: 56px; padding-bottom: 56px; }  /* niente shorthand: il container ha padding laterale */
.home .hero h1 { font-size: clamp(1.9rem, 1.3rem + 2.2vw, 2.7rem); text-wrap: balance; }
.home .hero-cta { min-height: 48px; padding: 0 28px; }
.home .hero-badges span { line-height: 1.3; }
.home .trust-strip-inner { gap: 16px 20px; }
.home .trust-item small { display: block; line-height: 1.35; }
.home .section-head { flex-wrap: wrap; gap: 6px 16px; margin-bottom: 22px; }
.home .section-head h2 { font-size: clamp(1.4rem, 1.2rem + 0.9vw, 1.8rem); }
.home .section-head a { min-height: 44px; display: inline-flex; align-items: center; }
.home .section { padding: 48px 0; }
@media (max-width: 860px) {
    .home .hero-inner { padding-top: 32px; padding-bottom: 36px; gap: 20px; }
    .home .hero p { margin-bottom: 20px; }
    .home .hero-badges { gap: 8px; margin-bottom: 22px; }
    .home .hero-badges span { font-size: 0.78rem; padding: 6px 12px; }
    .home .hero-cta { width: 100%; justify-content: center; }
    .home .trust-strip-inner { grid-template-columns: repeat(2, minmax(0, 1fr)); padding-top: 20px; padding-bottom: 20px; }
    .home .trust-item { align-items: flex-start; }
    .home .section { padding: 36px 0; }
}
@media (max-width: 380px) {
    .home .trust-strip-inner { grid-template-columns: minmax(0, 1fr); }
}

/* =====================================================================
   Scheda prodotto
   ===================================================================== */
body.single-product .site-main { padding-bottom: 8px; }
body.single-product .woocommerce-breadcrumb {
    margin: 0 0 18px; font-size: 0.85rem; line-height: 1.5; color: var(--gray);
}
body.single-product .woocommerce-breadcrumb a { color: var(--teal); font-weight: 500; }

body.single-product.woocommerce div.product {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 28px 40px; align-items: start;
}
/* clearfix di WooCommerce = celle fantasma della griglia */
body.single-product.woocommerce div.product::before,
body.single-product.woocommerce div.product::after { content: none; display: none; }
body.single-product.woocommerce div.product div.images,
body.single-product.woocommerce div.product div.summary { float: none; width: auto; margin: 0; }
body.single-product.woocommerce div.product .woocommerce-tabs,
body.single-product.woocommerce div.product .related,
body.single-product.woocommerce div.product .upsells { grid-column: 1 / -1; float: none; width: auto; clear: both; }

body.single-product.woocommerce div.product div.images {
    position: relative; padding: 12px; background: var(--white);
    border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
body.single-product.woocommerce div.product div.images img {
    width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: contain;
    padding: 0; border: 0 !important; border-radius: 8px; background: var(--white);
}
body.single-product .flex-control-thumbs { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 10px 0 0; padding: 0; }
body.single-product .flex-control-thumbs li { width: 64px; margin: 0; }
body.single-product .flex-control-thumbs img { border: 1px solid var(--border) !important; border-radius: 8px; opacity: 0.75; cursor: pointer; }
body.single-product .flex-control-thumbs img.flex-active, body.single-product .flex-control-thumbs img:hover { opacity: 1; border-color: var(--teal) !important; }
body.single-product .woocommerce-product-gallery__trigger { top: 18px; right: 18px; }

body.single-product.woocommerce div.product div.summary {
    padding: 28px; background: var(--white);
    border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm);
    -webkit-backdrop-filter: none; backdrop-filter: none;
}
body.single-product .product_title { margin: 0 0 10px; font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); line-height: 1.2; overflow-wrap: anywhere; }
body.single-product.woocommerce div.product p.price,
body.single-product.woocommerce div.product span.price { margin: 0 0 16px; font-size: 1.7rem; line-height: 1.2; font-weight: 700; color: var(--teal); }
body.single-product .woocommerce-product-details__short-description { margin: 0 0 18px; color: var(--ink); line-height: 1.6; }
body.single-product p.stock {
    display: inline-block; margin: 0 0 18px; padding: 4px 14px; border-radius: 999px;
    background: rgba(0, 112, 122, 0.1); color: var(--teal); font-size: 0.82rem; font-weight: 600;
}
body.single-product p.stock.out-of-stock { background: rgba(179, 38, 30, 0.1); color: var(--fm-danger); }

body.single-product form.cart { display: flex; flex-wrap: wrap; gap: 12px; align-items: stretch; margin: 0 0 22px; }
body.single-product form.cart::before, body.single-product form.cart::after { display: none; }
body.single-product form.cart .quantity { float: none; margin: 0; }
body.single-product form.cart .quantity input.qty {
    width: 88px; min-height: 52px; padding: 0 8px; text-align: center;
    font-size: 1.05rem; font-weight: 600; background: var(--white);
    border: 1px solid #c9c2b2; border-radius: 999px;
}
body.single-product form.cart .single_add_to_cart_button { float: none; flex: 1 1 150px; min-height: 52px; font-size: 1rem; padding: 12px 16px !important; white-space: nowrap; }
body.single-product .product_meta {
    display: grid; gap: 6px; margin: 0; padding-top: 16px;
    border-top: 1px solid var(--border); font-size: 0.85rem; color: var(--gray);
}
body.single-product .product_meta > span { display: block; }
body.single-product .product_meta a { color: var(--teal); font-weight: 600; }

body.single-product.woocommerce div.product .woocommerce-tabs {
    padding: 4px 24px 24px; background: var(--white);
    border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm);
    -webkit-backdrop-filter: none; backdrop-filter: none;
}
body.single-product.woocommerce div.product .woocommerce-tabs ul.tabs {
    display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 20px; padding: 16px 0 14px;
    list-style: none; border-bottom: 1px solid var(--border); overflow: visible;
}
body.single-product.woocommerce div.product .woocommerce-tabs ul.tabs::before,
body.single-product.woocommerce div.product .woocommerce-tabs ul.tabs li::before,
body.single-product.woocommerce div.product .woocommerce-tabs ul.tabs li::after { display: none; }
body.single-product.woocommerce div.product .woocommerce-tabs ul.tabs li { margin: 0; padding: 0; background: none; border: 0; border-radius: 999px; }
body.single-product.woocommerce div.product .woocommerce-tabs ul.tabs li a {
    display: inline-flex; align-items: center; min-height: 44px; padding: 0 20px;
    border-radius: 999px; background: var(--cream); color: var(--navy); font-weight: 600; font-size: 0.92rem;
}
body.single-product.woocommerce div.product .woocommerce-tabs ul.tabs li.active a { background: var(--navy); color: var(--white); }
body.single-product .woocommerce-Tabs-panel h2 { font-size: 1.35rem; margin: 0 0 12px; }
body.single-product .comment-form p { margin: 0 0 16px; }
body.single-product .comment-form .comment-form-cookies-consent label { display: inline; font-weight: 400; }
body.single-product .comment-form p.stars a { font-size: 1.1rem; }

body.single-product .related > h2, body.single-product .upsells > h2 { margin: 12px 0 18px; font-size: clamp(1.35rem, 1.15rem + 0.8vw, 1.7rem); }

@media (max-width: 860px) {
    body.single-product.woocommerce div.product { grid-template-columns: minmax(0, 1fr); gap: 20px; }
    body.single-product.woocommerce div.product div.summary { padding: 20px; }
    body.single-product.woocommerce div.product .woocommerce-tabs { padding: 2px 16px 18px; }
    body.single-product.woocommerce div.product .woocommerce-tabs ul.tabs { padding-top: 12px; }
}

/* =====================================================================
   Carrello e cassa (blocchi WooCommerce): solo aspetto
   ===================================================================== */
body .wc-block-components-button:not(.is-link),
body .wc-block-cart__submit-button,
body .wc-block-components-checkout-place-order-button {
    background-color: var(--navy); color: var(--white);
    border: 0; border-radius: 999px; font-family: var(--font-body); font-weight: 600;
    min-height: 48px; padding: 12px 26px; letter-spacing: 0.1px; transition: background-color .15s ease, box-shadow .15s ease;
}
body .wc-block-components-button:not(.is-link):hover,
body .wc-block-cart__submit-button:hover,
body .wc-block-components-checkout-place-order-button:hover { background-color: var(--teal); color: var(--white); }
body .wc-block-components-button:not(.is-link):focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
body .wc-block-cart__submit-button,
body .wc-block-components-checkout-place-order-button { min-height: 54px; font-size: 1rem; }
body .wc-block-components-button.is-link, body .wc-block-components-checkout-return-to-cart-button { color: var(--teal); }

/* Carrello */
body.woocommerce-cart .wc-block-cart__main { min-width: 0; }
body.woocommerce-cart .wc-block-cart-items { border-collapse: separate; border-spacing: 0; }
body.woocommerce-cart .wc-block-cart-items__header th {
    padding: 0 0 12px; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--teal);
}
body.woocommerce-cart .wc-block-cart-items__row td { padding-top: 20px; padding-bottom: 20px; vertical-align: top; }
body.woocommerce-cart .wc-block-cart-item__image img {
    width: 88px; height: 88px; object-fit: contain; background: var(--white);
    border: 1px solid var(--border); border-radius: 10px; padding: 6px;
}
body.woocommerce-cart .wc-block-components-product-name { font-weight: 600; color: var(--navy); }
body.woocommerce-cart .wc-block-components-product-name:hover { color: var(--teal); }
body.woocommerce-cart .wc-block-components-quantity-selector {
    border: 1px solid #c9c2b2; border-radius: 999px; background: var(--white); overflow: hidden;
}
body.woocommerce-cart .wc-block-components-quantity-selector::after { display: none; }
body.woocommerce-cart .wc-block-components-quantity-selector__button { min-width: 40px; min-height: 40px; }
body.woocommerce-cart .wc-block-cart-item__remove-link { min-height: 40px; display: inline-flex; align-items: center; color: var(--gray); }
body.woocommerce-cart .wc-block-cart-item__remove-link:hover { color: var(--fm-danger); }
body.woocommerce-cart .wc-block-cart__sidebar {
    box-sizing: border-box; margin-left: 28px; width: calc(35% - 28px);
    padding: 22px 22px 24px; background: var(--white);
    border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm);
    align-self: start;
}
body.woocommerce-cart .wc-block-cart__totals-title {
    margin: 0 0 8px; padding: 0; font-family: var(--font-body); font-size: 0.75rem; font-weight: 700;
    letter-spacing: 0.1em; text-transform: uppercase; color: var(--teal);
}
body.woocommerce-cart .wc-block-components-totals-footer-item .wc-block-components-totals-item__value { color: var(--navy); font-weight: 700; }
body.woocommerce-cart .wc-block-cart__payment-options { margin-top: 12px; }

/* Cassa */
body.woocommerce-checkout .wc-block-checkout__main { min-width: 0; }
body.woocommerce-checkout .wc-block-components-checkout-step__title {
    font-family: var(--font-head); font-size: 1.25rem; color: var(--navy);
}
body.woocommerce-checkout .wc-block-checkout__sidebar { top: calc(var(--fm-header-h) + 16px); }
@media (min-width: 783px) {
    /* da mobile resta il riepilogo nativo (comprimibile): niente scheda aggiuntiva */
    body.woocommerce-checkout .wp-block-woocommerce-checkout-order-summary-block {
        background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm);
    }
}
body.woocommerce-checkout .wc-block-components-checkout-order-summary__title-text { font-family: var(--font-head); color: var(--navy); }
body.woocommerce-checkout .wc-block-components-order-summary-item__image img { object-fit: contain; background: var(--white); border-radius: 8px; }
body.woocommerce-checkout .wc-block-components-text-input input[type],
body.woocommerce-checkout .wc-blocks-components-select .wc-blocks-components-select__select,
body.woocommerce-checkout .wc-block-components-textarea {
    border-radius: 10px !important; border-color: #c9c2b2 !important; background-color: var(--white);
}
body.woocommerce-checkout .wc-block-components-text-input input[type]:focus,
body.woocommerce-checkout .wc-blocks-components-select .wc-blocks-components-select__select:focus { border-color: var(--teal) !important; box-shadow: var(--fm-ring); outline: none; }
body.woocommerce-checkout .wc-block-components-address-card { border-radius: 10px; border-color: var(--border); background: var(--white); }
body.woocommerce-checkout .wc-block-components-radio-control__option { border-radius: 10px; }
body.woocommerce-checkout .wc-block-components-radio-control-accordion-option,
body.woocommerce-checkout .wc-block-components-radio-control--highlight-checked .wc-block-components-radio-control__option-checked {
    border-radius: 10px;
}
body.woocommerce-checkout .wc-block-components-radio-control input[type="radio"]:checked,
body.woocommerce-checkout .wc-block-components-checkbox input[type="checkbox"]:checked { accent-color: var(--teal); }
body.woocommerce-checkout .wc-block-checkout__terms a { color: var(--teal); font-weight: 600; text-decoration: underline; }
body.woocommerce-checkout .wc-block-components-notice-banner { border-radius: 10px; }

@media (max-width: 782px) {
    body.woocommerce-cart .wc-block-cart__sidebar { margin-left: 0; width: 100%; padding: 18px; }
    body.woocommerce-cart .wc-block-cart-item__image img { width: 72px; height: 72px; }
    body.woocommerce-checkout .wc-block-checkout__sidebar { position: static; }
}

/* =====================================================================
   Account (shortcode WooCommerce)
   ===================================================================== */
body.woocommerce-account .woocommerce { max-width: 100%; }
body.woocommerce-account .woocommerce > h2,
body.woocommerce-account .woocommerce-ResetPassword,
body.woocommerce-account .u-columns h2 { font-size: 1.35rem; margin: 0 0 14px; }
body.woocommerce-account form.woocommerce-form-login,
body.woocommerce-account form.woocommerce-form-register,
body.woocommerce-account form.woocommerce-ResetPassword,
body.woocommerce-account form.lost_reset_password {
    max-width: 560px; margin: 0 0 24px; padding: 28px;
    background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
body.woocommerce-account .woocommerce-form-login .form-row { margin: 0 0 16px; padding: 0; }
body.woocommerce-account .woocommerce-form-login__rememberme { display: inline-flex; align-items: center; margin: 0 16px 0 0; font-weight: 500; }
body.woocommerce-account .woocommerce-form-login__submit { min-height: 48px; }
body.woocommerce-account .woocommerce-LostPassword { margin: 4px 0 0; }
body.woocommerce-account .woocommerce-LostPassword a { color: var(--teal); font-weight: 600; text-decoration: underline; }
body.woocommerce-account .password-input { position: relative; display: block; }
body.woocommerce-account .show-password-input { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; }
body.woocommerce-account .woocommerce-form-login .password-input input { padding-right: 48px; }
body.woocommerce-account .u-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
body.woocommerce-account .u-columns::before, body.woocommerce-account .u-columns::after { display: none; }
body.woocommerce-account .u-columns .u-column1, body.woocommerce-account .u-columns .u-column2 { float: none; width: auto; }

/* Area riservata (utente connesso): navigazione + contenuto */
body.woocommerce-account.logged-in .woocommerce { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 28px; align-items: start; }
body.woocommerce-account.logged-in .woocommerce::before, body.woocommerce-account.logged-in .woocommerce::after { display: none; }
body.woocommerce-account.logged-in .woocommerce-notices-wrapper { grid-column: 1 / -1; }
body.woocommerce-account .woocommerce-MyAccount-navigation,
body.woocommerce-account .woocommerce-MyAccount-content { float: none; width: auto; }
body.woocommerce-account .woocommerce-MyAccount-navigation ul {
    list-style: none; margin: 0; padding: 8px; background: var(--white);
    border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
body.woocommerce-account .woocommerce-MyAccount-navigation li { margin: 0; }
body.woocommerce-account .woocommerce-MyAccount-navigation a {
    display: flex; align-items: center; min-height: 46px; padding: 0 14px; border-radius: 8px;
    color: var(--ink); font-weight: 500; font-size: 0.95rem;
}
body.woocommerce-account .woocommerce-MyAccount-navigation a:hover { background: var(--cream); color: var(--teal); }
body.woocommerce-account .woocommerce-MyAccount-navigation .is-active a { background: var(--teal); color: var(--white); font-weight: 600; }
body.woocommerce-account .woocommerce-MyAccount-content {
    padding: 24px; background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
body.woocommerce-account .woocommerce-MyAccount-content a:not(.button) { color: var(--teal); font-weight: 600; }
body.woocommerce-account table.shop_table, body.woocommerce-account table.my_account_orders {
    width: 100%; border-collapse: collapse; background: var(--white); backdrop-filter: none; -webkit-backdrop-filter: none; padding: 0;
}
body.woocommerce-account table.shop_table th, body.woocommerce-account table.shop_table td { padding: 12px 10px; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--border); }
body.woocommerce-account .woocommerce-Addresses { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
body.woocommerce-account .woocommerce-Addresses::before, body.woocommerce-account .woocommerce-Addresses::after { display: none; }
body.woocommerce-account .woocommerce-Addresses .col-1, body.woocommerce-account .woocommerce-Addresses .col-2 { float: none; width: auto; }
body.woocommerce-account .woocommerce-Address-title h2, body.woocommerce-account .woocommerce-Address-title h3 { font-size: 1.15rem; }
body.woocommerce-account .woocommerce-address-fields__field-wrapper,
body.woocommerce-account .woocommerce-EditAccountForm { display: block; }
body.woocommerce-account .woocommerce-EditAccountForm .form-row, body.woocommerce-account .woocommerce-address-fields .form-row { float: none; width: 100%; margin: 0 0 16px; }

@media (max-width: 860px) {
    body.woocommerce-account.logged-in .woocommerce { grid-template-columns: minmax(0, 1fr); gap: 18px; }
    body.woocommerce-account .woocommerce-MyAccount-navigation ul { display: flex; gap: 6px; overflow-x: auto; padding: 6px; scrollbar-width: thin; }
    body.woocommerce-account .woocommerce-MyAccount-navigation li { flex: 0 0 auto; }
    body.woocommerce-account .woocommerce-MyAccount-navigation a { white-space: nowrap; }
    body.woocommerce-account .woocommerce-MyAccount-content { padding: 18px; }
    body.woocommerce-account .u-columns, body.woocommerce-account .woocommerce-Addresses { grid-template-columns: minmax(0, 1fr); }
    body.woocommerce-account form.woocommerce-form-login, body.woocommerce-account form.woocommerce-form-register { padding: 20px; }
    /* Tabelle ordini: ogni riga diventa una scheda (WooCommerce fornisce già data-title) */
    body.woocommerce-account table.shop_table_responsive { background: transparent; border: 0; box-shadow: none; padding: 0; }
    body.woocommerce-account table.shop_table_responsive thead { display: none; }
    body.woocommerce-account table.shop_table_responsive tr { display: block; margin: 0 0 14px; background: var(--white); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
    body.woocommerce-account table.shop_table_responsive td,
    body.woocommerce-account table.shop_table_responsive tbody th { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 10px 14px; text-align: right; border-bottom: 1px solid var(--border); }
    body.woocommerce-account table.shop_table_responsive tr > :last-child { border-bottom: 0; }
    body.woocommerce-account table.shop_table_responsive td::before,
    body.woocommerce-account table.shop_table_responsive tbody th::before { content: attr(data-title); font-weight: 700; color: var(--navy); text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
    body .wc-block-components-button:not(.is-link) { transition: none; }
}
