/* ── Icona carrello header ───────────────────────────────────────────────── */
/* L'icona è dentro .header-actions — sempre visibile desktop e mobile */
.cwc-cart-nav-item,
.cwc-cart-icon,
a.cwc-cart-icon {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}
.cwc-cart-nav-item {
    align-items: center;
    padding: 0 !important;
}
.cwc-cart-icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    color: rgba(255, 255, 255, .85);
    text-decoration: none !important;
    transition: color .2s;
    line-height: 1;
}
.cwc-cart-icon:hover,
.cwc-cart-icon:focus {
    color: #C9A84C;
    text-decoration: none !important;
}
.cwc-cart-icon svg {
    width: 22px;
    height: 22px;
    display: block;
    flex-shrink: 0;
}
.cwc-cart-badge {
    position: absolute;
    top: 1px;
    right: 3px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    background: #C9A84C;
    color: #fff;
    font-size: .6rem;
    font-weight: 700;
    line-height: 17px;
    text-align: center;
    border-radius: 9px;
    transform-origin: center;
    transition: transform .2s cubic-bezier(.34, 1.56, .64, 1), opacity .15s;
    pointer-events: none;
}
.cwc-cart-badge--hidden {
    transform: scale(0);
    opacity: 0;
}

/* Animazione pop quando il contatore aumenta */
@keyframes cwc-badge-pop {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.4); }
    100% { transform: scale(1); }
}
.cwc-cart-badge.pop {
    animation: cwc-badge-pop .3s ease forwards;
}

/* ── Overlay ─────────────────────────────────────────────────────────────── */
.cwc-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .55);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s ease, visibility .3s ease;
}
.cwc-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

/* ── Drawer shell ────────────────────────────────────────────────────────── */
.cwc-drawer {
    position: fixed;
    top: 0;
    right: 0;
    height: 100%;
    width: 400px;
    max-width: 100vw;
    background: #fff;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    box-shadow: -6px 0 32px rgba(0, 0, 0, .18);
    transform: translateX(100%);
    transition: transform .35s cubic-bezier(.25, .46, .45, .94);
}
.cwc-drawer.is-open {
    transform: translateX(0);
}

/* Blocca lo scroll del body quando il drawer è aperto */
body.cwc-open {
    overflow: hidden;
}

/* ── Header ──────────────────────────────────────────────────────────────── */
.cwc-drawer__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    background: #1a1f2e;
    flex-shrink: 0;
}
.cwc-drawer__title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    color: #fff;
    letter-spacing: .02em;
}
.cwc-drawer__close {
    background: none;
    border: none;
    color: rgba(255,255,255,.75);
    font-size: 1.6rem;
    line-height: 1;
    padding: 2px 6px;
    cursor: pointer;
    transition: color .2s;
}
.cwc-drawer__close:hover {
    color: #fff;
}

/* ── Items area ──────────────────────────────────────────────────────────── */
.cwc-drawer__items {
    flex: 1;
    overflow-y: auto;
    padding: 8px 16px;
    /* Scrollbar sottile */
    scrollbar-width: thin;
    scrollbar-color: #d1d5db transparent;
}
.cwc-drawer__items::-webkit-scrollbar       { width: 4px; }
.cwc-drawer__items::-webkit-scrollbar-track { background: transparent; }
.cwc-drawer__items::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 2px; }

/* Stato vuoto */
.cwc-drawer__empty {
    text-align: center;
    color: #9ca3af;
    padding: 48px 16px;
    font-style: italic;
    font-size: .95rem;
}

/* ── Singolo prodotto ────────────────────────────────────────────────────── */
.cwc-cart-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid #f3f4f6;
}
.cwc-cart-item:last-child {
    border-bottom: none;
}

.cwc-cart-item__img img {
    width: 72px;
    height: 90px;
    object-fit: cover;
    border-radius: 4px;
    display: block;
    flex-shrink: 0;
}
/* Placeholder WooCommerce */
.cwc-cart-item__img img[src*="placeholder"] {
    object-fit: contain;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
}

.cwc-cart-item__body {
    flex: 1;
    min-width: 0;
}
.cwc-cart-item__name {
    margin: 0 0 5px;
    font-size: .88rem;
    font-weight: 600;
    color: #111827;
    line-height: 1.35;
}
.cwc-cart-item__meta {
    margin: 0;
    font-size: .82rem;
    color: #6b7280;
}
.cwc-cart-item__meta .woocommerce-Price-amount {
    color: #C9A84C;
    font-weight: 600;
}

.cwc-cart-item__remove {
    flex-shrink: 0;
    background: none;
    border: 1px solid #e5e7eb;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    font-size: 1.1rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #9ca3af;
    transition: background .18s, border-color .18s, color .18s;
    margin-top: 2px;
}
.cwc-cart-item__remove:hover {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #dc2626;
}
/* Animazione di uscita quando si rimuove */
.cwc-cart-item.is-removing {
    opacity: 0;
    transform: translateX(30px);
    transition: opacity .25s ease, transform .25s ease;
}

/* ── Footer ──────────────────────────────────────────────────────────────── */
.cwc-drawer__footer {
    padding: 16px 20px 20px;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
    flex-shrink: 0;
}
.cwc-drawer--empty .cwc-drawer__footer {
    display: none;
}

.cwc-drawer__total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1rem;
    font-weight: 700;
    color: #1a1f2e;
    margin-bottom: 14px;
}
.cwc-drawer__total-amount .woocommerce-Price-amount {
    color: #C9A84C;
}

/* ── Bottoni ─────────────────────────────────────────────────────────────── */
.cwc-btn {
    display: block;
    width: 100%;
    padding: 12px 16px;
    margin-bottom: 8px;
    border: none;
    border-radius: 6px;
    font-size: .9rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background .2s, color .2s, transform .1s;
}
.cwc-btn:last-child { margin-bottom: 0; }
.cwc-btn:active     { transform: scale(.98); }

.cwc-btn--primary {
    background: #C9A84C;
    color: #fff;
}
.cwc-btn--primary:hover {
    background: #b8973d;
    color: #fff;
    text-decoration: none;
}

.cwc-btn--secondary {
    background: #1a1f2e;
    color: #fff;
}
.cwc-btn--secondary:hover {
    background: #1a1f2e;
    color: #fff;
    text-decoration: none;
}

.cwc-btn--ghost {
    background: transparent;
    color: #6b7280;
    font-weight: 400;
    font-size: .82rem;
    padding: 8px 16px;
}
.cwc-btn--ghost:hover {
    color: #374151;
}

/* ── Mobile ──────────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
    .cwc-drawer {
        width: 100vw;
    }
}

/* Icona carrello sempre visibile su mobile + ordine: hamburger prima, carrello dopo */
@media (max-width: 900px) {
    .cwc-cart-nav-item {
        display: flex !important;
    }
    .menu-toggle,
    .nav-toggle,
    .hamburger {
        order: 1;
    }
    .cwc-cart-nav-item,
    .cwc-cart-icon,
    a.cwc-cart-icon {
        order: 2;
    }
}

/* ── Banner Supporta la missione ─────────────────────────────────────────── */
.cwc-mission-banner { background: #1a1f2e; padding: 60px 20px; text-align: center; }
.cwc-mission-banner__inner { max-width: 600px; margin: 0 auto; }
.cwc-mission-banner p { color: #fff; font-size: 1.1rem; margin-bottom: 24px; }
.cwc-mission-banner__btn { display: inline-block; padding: 16px 32px; background: #C9A84C; color: #1a1f2e; border-radius: 8px; font-weight: 700; text-decoration: none; font-size: 1rem; }
.cwc-mission-banner__btn:hover { background: #b8933d;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Sezione negozio homepage
   ═══════════════════════════════════════════════════════════════════════════ */
.cwc-shop-home {
    background: #f7f5f0;
    padding: 72px 0 80px;
}

/* Header */
.cwc-shop-home__header {
    text-align: center;
    margin-bottom: 48px;
}
.cwc-shop-home__title {
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    font-weight: 700;
    color: #1a1f2e;
    margin: 0 0 12px;
    letter-spacing: -.01em;
}
.cwc-shop-home__subtitle {
    font-size: 1.05rem;
    color: #6b7280;
    margin: 0;
}

/* Griglia 3 colonne */
.cwc-shop-home__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}
@media (max-width: 900px) {
    .cwc-shop-home__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 580px) {
    .cwc-shop-home__grid {
        grid-template-columns: 1fr;
        max-width: 420px;
    }
}

/* Card libro */
.cwc-book-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .08);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow .25s, transform .25s;
}
.cwc-book-card:hover {
    box-shadow: 0 8px 28px rgba(0, 0, 0, .14);
    transform: translateY(-3px);
}

/* Copertina */
.cwc-book-card__cover-link {
    display: block;
    position: relative;
    background: #e9e5de;
    overflow: hidden;
    aspect-ratio: 2 / 3;
    flex-shrink: 0;
}
.cwc-book-card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .35s ease;
}
.cwc-book-card:hover .cwc-book-card__img {
    transform: scale(1.03);
}
.cwc-book-card__img-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #d4cfc6 0%, #b8b0a3 100%);
}
.cwc-book-card__badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #1a1f2e;
    color: #C9A84C;
    font-size: .65rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 3px;
}

/* Corpo card */
.cwc-book-card__body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.cwc-book-card__title {
    font-size: .95rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 10px;
    line-height: 1.35;
}
.cwc-book-card__title a {
    color: inherit;
    text-decoration: none;
}
.cwc-book-card__title a:hover {
    color: #C9A84C;
}
.cwc-book-card__desc {
    font-size: .82rem;
    color: #6b7280;
    line-height: 1.55;
    margin: 0 0 16px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

/* Footer card */
.cwc-book-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: auto;
}
.cwc-book-card__price {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1a1f2e;
    white-space: nowrap;
}
.cwc-book-card__price .woocommerce-Price-amount {
    color: #1a1f2e;
}

/* CTA bottoni */
.cwc-book-card__btn {
    display: inline-block;
    padding: 8px 14px;
    border-radius: 5px;
    font-size: .8rem;
    font-weight: 600;
    text-decoration: none !important;
    white-space: nowrap;
    cursor: pointer;
    transition: background .2s, color .2s;
    border: none;
}
.cwc-book-card__btn--ebook {
    background: #C9A84C;
    color: #fff;
}
.cwc-book-card__btn--ebook:hover {
    background: #b8973d;
    color: #fff;
}
.cwc-book-card__btn--amazon {
    background: #1a1f2e;
    color: #fff;
}
.cwc-book-card__btn--amazon:hover {
    background: #1a1f2e;
    color: #fff;
}

/* CTA "Vedi tutti" */
.cwc-shop-home__footer {
    text-align: center;
    margin-top: 44px;
}
.cwc-shop-home__btn {
    display: inline-block;
    padding: 13px 32px;
    border: 2px solid #1a1f2e;
    border-radius: 6px;
    color: #1a1f2e;
    font-size: .95rem;
    font-weight: 600;
    text-decoration: none;
    transition: background .2s, color .2s;
}
.cwc-shop-home__btn:hover {
    background: #1a1f2e;
    color: #fff;
}
