/* shop_header.css — shared header + trust bar styles for all store pages */

/* Header */
.header {
    background: rgba(255,255,255,0.92);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(16px) saturate(1.4);
    -webkit-backdrop-filter: blur(16px) saturate(1.4);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 18px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    color: var(--text-dark);
}

.logo-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: transparent;
    overflow: hidden;
    flex-shrink: 0;
}

.logo-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.logo-text h1 {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-dark);
    font-family: var(--font-serif, 'Fraunces', Georgia, serif);
    line-height: 1.1;
}

.logo-text p {
    font-size: 0.78rem;
    color: var(--text-light);
    font-weight: 500;
    letter-spacing: 0.02em;
    margin-top: 2px;
}

.header-nav {
    display: flex;
    gap: 10px;
    align-items: center;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    border-radius: var(--radius-sm, 12px);
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--text-medium);
    background: var(--bg-muted, #f5f2ed);
    border: 1px solid transparent;
    transition: var(--transition, all 0.2s ease);
    cursor: pointer;
}

.nav-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(-1px);
}

.nav-btn:focus-visible,
.cart-drawer button:focus-visible,
.cart-drawer a:focus-visible,
.whatsapp-float:focus-visible {
    outline: 3px solid rgba(74, 124, 89, 0.4);
    outline-offset: 3px;
}

.nav-btn i { font-size: 1rem; }

/* Primary (filled) nav button — used for Accedi when logged out */
.nav-btn--primary {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}
.nav-btn--primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: white;
}

/* User dropdown */
.user-dropdown-wrap { position: relative; }
.user-dropdown-toggle { cursor: pointer; }
.user-dropdown-arrow {
    font-size: 0.55rem;
    margin-left: 2px;
    opacity: 0.5;
    transition: transform 0.25s;
}
.user-dropdown-wrap.open .user-dropdown-arrow { transform: rotate(180deg); }

.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 190px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.10);
    padding: 6px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px) scale(0.97);
    transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
    z-index: 500;
}
.user-dropdown-wrap.open .user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}
.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-dark);
    text-decoration: none;
    border-radius: 10px;
    transition: background 0.15s;
}
.user-dropdown-item:hover { background: #f8fafc; color: #111827; }
.user-dropdown-item:focus-visible { outline: 3px solid rgba(74, 124, 89, 0.35); outline-offset: 1px; background: #f8fafc; }
.user-dropdown-item i { width: 16px; text-align: center; font-size: 0.85rem; color: #94a3b8; }
.user-dropdown-item:hover i { color: #64748b; }
.user-dropdown-item--danger { color: #dc2626; }
.user-dropdown-item--danger i { color: #dc2626 !important; }
.user-dropdown-item--danger:hover { background: #fef2f2; color: #b91c1c; }
.user-dropdown-divider { height: 1px; background: #f1f5f9; margin: 4px 8px; }

/* Cart button */
.cart-btn {
    position: relative;
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}
.cart-btn:hover { background: var(--primary-dark); border-color: var(--primary-dark); }

.cart-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 20px;
    height: 20px;
    border-radius: 999px;
    background: var(--terracotta, #c0785f);
    color: white;
    font-size: 0.68rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid white;
}

.cart-badge.empty { display: none; }

/* Trust Bar */
.trust-bar {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 14px 32px;
}
.trust-bar-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
    align-items: center;
}
.trust-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-medium);
    letter-spacing: 0.01em;
}
.trust-item i { color: var(--accent-dark, #6b8f5e); font-size: 0.95rem; }

/* Mini cart drawer */
.cart-drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.35);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s, visibility 0.25s;
    z-index: 900;
}
.cart-drawer-overlay.open { opacity: 1; visibility: visible; }

.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.cart-drawer {
    position: fixed;
    top: 0; right: 0;
    width: 380px; max-width: 90vw;
    height: 100vh;
    height: 100dvh;
    background: #fff;
    box-shadow: -8px 0 40px rgba(0,0,0,0.12);
    transform: translateX(100%);
    visibility: hidden;
    transition: transform 0.3s var(--ease-out, ease), visibility 0.3s;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    outline: none;
}
.cart-drawer.open { transform: translateX(0); visibility: visible; transition-delay: 0s; }

.cart-drawer-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 22px;
    border-bottom: 1px solid var(--border, #e8e4df);
}
.cart-drawer-header h2 { font-size: 1.05rem; font-weight: 700; color: var(--text-dark); display: flex; align-items: center; gap: 10px; margin: 0; }
.cart-drawer-header h2 i { color: var(--primary); }
.cart-drawer-close {
    background: none; border: none; font-size: 1.2rem; color: var(--text-light); cursor: pointer;
    width: 36px; height: 36px; border-radius: 50%; transition: background 0.15s;
}
.cart-drawer-close:hover { background: var(--bg-muted, #f5f2ed); color: var(--text-dark); }

.cart-drawer-body { flex: 1; overflow-y: auto; padding: 16px; }
.cart-drawer-loading, .cart-drawer-empty, .cart-drawer-error {
    text-align: center; padding: 40px 20px; color: var(--text-light); font-size: 0.9rem;
}
.cart-drawer-empty i, .cart-drawer-error i { font-size: 2.2rem; display: block; margin-bottom: 12px; }
.cart-drawer-error i { color: #dc2626; }
.cart-drawer-empty .cart-drawer-btn { margin-top: 16px; }

.cart-drawer-items { display: flex; flex-direction: column; gap: 14px; }
.cart-drawer-item {
    display: flex; align-items: center; gap: 12px;
    background: var(--bg-muted, #f5f2ed); border-radius: 14px; padding: 12px;
}
.cart-drawer-item-img {
    width: 58px; height: 58px; border-radius: 10px; background: #fff;
    display: flex; align-items: center; justify-content: center; overflow: hidden; flex-shrink: 0;
}
.cart-drawer-item-img img { width: 100%; height: 100%; object-fit: cover; }
.cart-drawer-item-img i { color: var(--accent-dark); font-size: 1.2rem; }
.cart-drawer-item-info { flex: 1; min-width: 0; }
.cart-drawer-item-name { font-size: 0.85rem; font-weight: 600; color: var(--text-dark); margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cart-drawer-item-name a { color: inherit; text-decoration: none; }
.cart-drawer-item-name a:hover { color: var(--primary); }
.cart-drawer-item-price { font-size: 0.8rem; color: var(--text-medium); font-weight: 600; margin-bottom: 6px; }
.cart-drawer-item-variant { font-size: 0.78rem; color: #64748b; margin: 2px 0 4px; }
.cart-drawer-item-qty { display: inline-flex; align-items: center; gap: 8px; background: #fff; border-radius: 999px; padding: 3px; border: 1px solid var(--border); }
.cart-drawer-item-qty button {
    width: 24px; height: 24px; border-radius: 50%; border: none; background: var(--bg-muted); color: var(--text-dark);
    font-weight: 700; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.cart-drawer-item-qty button:hover { background: var(--primary); color: #fff; }
.cart-drawer-item-qty span { min-width: 22px; text-align: center; font-size: 0.8rem; font-weight: 600; }
.cart-drawer-item-remove {
    background: none; border: none; color: var(--text-light); font-size: 1rem; cursor: pointer; padding: 6px;
    transition: color 0.15s; flex-shrink: 0;
}
.cart-drawer-item-remove:hover { color: #dc2626; }

.cart-drawer-footer {
    border-top: 1px solid var(--border); padding: 18px 22px; background: #fff;
}
.cart-drawer-shipping-note { text-align: center; font-size: 0.78rem; color: var(--text-light); margin-bottom: 10px; }
.cart-drawer-total {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 1.1rem; font-weight: 700; color: var(--text-dark); margin-bottom: 14px;
}
.cart-drawer-btn {
    display: block; width: 100%; text-align: center; text-decoration: none;
    background: var(--primary); color: #fff; border-radius: 999px; padding: 12px;
    font-weight: 700; font-size: 0.9rem; margin-bottom: 10px; transition: background 0.2s, transform 0.2s;
}
.cart-drawer-btn:hover { background: var(--primary-dark); transform: translateY(-1px); }
.cart-drawer-btn--secondary { background: var(--bg-muted); color: var(--text-dark); }
.cart-drawer-btn--secondary:hover { background: var(--border); }

/* Responsive */
@media (max-width: 640px) {
    .header-content { padding: 8px 12px; }
    .logo-icon { width: 40px; height: 40px; }
    .logo-text h1 { font-size: 0.95rem; }
    .logo-text p { display: none; }
    .nav-btn { padding: 8px 12px; }
    .trust-bar-content { gap: 12px; }
    .trust-bar { padding: 10px 12px; }
    .trust-item { font-size: 0.75rem; }
    .trust-item i { font-size: 0.9rem; }
    .nav-btn span { display: none; }
}

/* WhatsApp floating button */
.whatsapp-float {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 8px;
    background: #25d366;
    color: #fff;
    padding: 12px 16px;
    border-radius: 999px;
    box-shadow: 0 2px 10px rgba(37, 211, 102, 0.18);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: transform 0.2s, box-shadow 0.2s;
}
.whatsapp-float:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(37, 211, 102, 0.22);
}
.whatsapp-float i { font-size: 1.35rem; }
@media (max-width: 640px) {
    .whatsapp-float span { display: none; }
    .whatsapp-float {
        padding: 10px;
        bottom: 12px;
        right: 12px;
        box-shadow: 0 1px 6px rgba(37, 211, 102, 0.12);
    }
    .whatsapp-float i { font-size: 1.15rem; }
}

@media (prefers-reduced-motion: reduce) {
    .nav-btn,
    .user-dropdown,
    .user-dropdown-arrow,
    .cart-drawer,
    .cart-drawer-overlay,
    .cart-drawer-btn,
    .whatsapp-float { transition: none !important; }
}
