/* Cart drawer (2026-11-27) - slide-in cart, see custom/js/wphh-cart-drawer.js and includes/cart-drawer.tpl.
   Every rule is scoped to .wphh-cd so theme / client-area CSS (e.g. phone `a, button { min-height: 44px }`) can't reach it. */
.wphh-cd {
    --cd-ink: #111827;
    --cd-muted: #6b7280;
    --cd-line: #e5e7eb;
    --cd-soft: #f9fafb;
    --cd-green: #16a34a;
    --cd-green-dark: #15803d;
    --cd-green-soft: #f0fdf4;
    --cd-red: #dc2626;
    position: fixed;
    inset: 0;
    z-index: 100000;
    font-family: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
    color: var(--cd-ink);
    -webkit-font-smoothing: antialiased;
}
.wphh-cd *, .wphh-cd *::before, .wphh-cd *::after { box-sizing: border-box; }
.wphh-cd a, .wphh-cd button { min-height: 0; min-width: 0; font-family: inherit; }
.wphh-cd :focus-visible { outline: 3px solid rgba(22, 163, 74, 0.45); outline-offset: 2px; }
.wphh-cd a:focus:not(:focus-visible), .wphh-cd button:focus:not(:focus-visible) { outline: none; }

.wphh-cd .wphh-cd-overlay {
    position: absolute;
    inset: 0;
    background: rgba(17, 24, 39, 0.5);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    opacity: 0;
    transition: opacity 0.3s ease;
    cursor: pointer;
}
.wphh-cd.is-open .wphh-cd-overlay { opacity: 1; }

.wphh-cd .wphh-cd-panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 420px;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    box-shadow: -24px 0 60px rgba(17, 24, 39, 0.18);
    transform: translateX(100%);
    transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1);
    outline: none;
}
.wphh-cd.is-open .wphh-cd-panel { transform: translateX(0); }

/* header */
.wphh-cd .wphh-cd-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 16px 16px 20px;
    padding-top: calc(16px + env(safe-area-inset-top, 0px));
    border-bottom: 1px solid var(--cd-line);
    flex-shrink: 0;
}
.wphh-cd .wphh-cd-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    font-size: 19px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.01em;
    color: var(--cd-ink);
}
.wphh-cd .wphh-cd-count:not(:empty) {
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--cd-green-soft);
    color: var(--cd-green-dark);
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: 0;
}
.wphh-cd .wphh-cd-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 10px;
    background: #f3f4f6;
    color: var(--cd-ink);
    font-size: 22px;
    cursor: pointer;
    transition: background 0.15s ease;
}
.wphh-cd .wphh-cd-close:hover { background: var(--cd-line); }

/* items */
.wphh-cd .wphh-cd-body {
    flex: 1 1 auto;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 4px 20px 16px;
}
.wphh-cd .wphh-cd-list { margin: 0; padding: 0; list-style: none; }
.wphh-cd .wphh-cd-item {
    position: relative;
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr) auto;
    gap: 14px;
    align-items: start;
    padding: 16px 0;
    border-bottom: 1px solid var(--cd-line);
    transition: opacity 0.2s ease;
}
.wphh-cd .wphh-cd-list > .wphh-cd-item:last-child { border-bottom: 0; }
.wphh-cd .wphh-cd-item.is-new { animation: wphh-cd-flash 1.8s ease-out; border-radius: 12px; }
.wphh-cd .wphh-cd-item.is-busy { opacity: 0.5; }
@keyframes wphh-cd-flash {
    0%, 45% { background: var(--cd-green-soft); box-shadow: 0 0 0 8px var(--cd-green-soft); }
    100% { background: rgba(240, 253, 244, 0); box-shadow: 0 0 0 8px rgba(240, 253, 244, 0); }
}
.wphh-cd .wphh-cd-thumb {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    overflow: hidden;
    border: 1px solid var(--cd-line);
    border-radius: 12px;
    background: var(--cd-soft);
    color: var(--cd-green);
    font-size: 25px;
}
.wphh-cd .wphh-cd-thumb-img { background: #ffffff; }
.wphh-cd .wphh-cd-thumb img { display: block; width: 100%; height: 100%; padding: 4px; object-fit: contain; }
.wphh-cd .wphh-cd-thumb-domain { color: #1372de; background: #eff6ff; border-color: #dbeafe; }
.wphh-cd .wphh-cd-thumb-hosting { background: var(--cd-green-soft); border-color: #dcfce7; }
.wphh-cd .wphh-cd-thumb-renewal, .wphh-cd .wphh-cd-thumb-upgrade { color: #b45309; background: #fffbeb; border-color: #fef3c7; }
.wphh-cd .wphh-cd-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; padding-top: 2px; }
.wphh-cd .wphh-cd-name {
    color: var(--cd-ink) !important;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
    text-decoration: none !important;
    overflow-wrap: anywhere;
}
.wphh-cd a.wphh-cd-name:hover { color: var(--cd-green-dark) !important; text-decoration: underline !important; text-underline-offset: 2px; }
.wphh-cd .wphh-cd-meta { color: var(--cd-muted); font-size: 13px; line-height: 1.4; overflow-wrap: anywhere; }
.wphh-cd .wphh-cd-note { color: var(--cd-muted); font-size: 12.5px; line-height: 1.4; }
.wphh-cd .wphh-cd-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; padding-top: 2px; }
.wphh-cd .wphh-cd-price { color: var(--cd-ink); font-size: 15px; font-weight: 700; white-space: nowrap; }
.wphh-cd .wphh-cd-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin-right: -8px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #9ca3af;
    font-size: 18px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}
.wphh-cd .wphh-cd-remove:hover { background: #fef2f2; color: var(--cd-red); }
.wphh-cd .wphh-cd-remove[disabled] { cursor: default; }
.wphh-cd .wphh-cd-confirm {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    grid-column: 1 / -1;
    padding: 10px 12px;
    border-radius: 10px;
    background: #fef2f2;
    color: #991b1b;
    font-size: 14px;
}
.wphh-cd .wphh-cd-confirm span { flex: 1 1 auto; font-weight: 600; }
.wphh-cd .wphh-cd-confirm button {
    padding: 8px 14px;
    border: 0;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}
.wphh-cd .wphh-cd-confirm-yes { background: var(--cd-red); color: #ffffff; }
.wphh-cd .wphh-cd-confirm-yes:hover { background: #b91c1c; }
.wphh-cd .wphh-cd-confirm-no { background: #ffffff; color: var(--cd-ink); box-shadow: inset 0 0 0 1px var(--cd-line); }

.wphh-cd .wphh-cd-pending { margin-top: 8px; padding-top: 4px; border-top: 1px dashed #d1d5db; }
.wphh-cd .wphh-cd-pending-title { margin: 12px 0 0; color: #b45309; font-size: 12px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; }
.wphh-cd .wphh-cd-setup {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
    color: var(--cd-green-dark) !important;
    font-size: 13.5px;
    font-weight: 700;
    text-decoration: none !important;
}
.wphh-cd .wphh-cd-setup:hover { text-decoration: underline !important; }

.wphh-cd .wphh-cd-notice {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 14px 0 2px;
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--cd-green-soft);
    color: #166534;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
}
.wphh-cd .wphh-cd-notice i { font-size: 18px; }
.wphh-cd .wphh-cd-notice.is-working { background: var(--cd-soft); color: var(--cd-muted); }

/* empty / error */
.wphh-cd .wphh-cd-empty { padding: 44px 4px 24px; text-align: center; }
.wphh-cd .wphh-cd-empty-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 76px;
    height: 76px;
    margin-bottom: 16px;
    border-radius: 50%;
    background: var(--cd-green-soft);
    color: var(--cd-green);
    font-size: 34px;
}
.wphh-cd .wphh-cd-error .wphh-cd-empty-icon { background: #fef2f2; color: var(--cd-red); }
.wphh-cd .wphh-cd-empty-title { margin: 0 0 6px; color: var(--cd-ink); font-size: 18px; font-weight: 700; }
.wphh-cd .wphh-cd-empty-text { max-width: 300px; margin: 0 auto 22px; color: var(--cd-muted); font-size: 14.5px; line-height: 1.5; }
.wphh-cd .wphh-cd-empty-links { display: flex; flex-direction: column; gap: 10px; max-width: 300px; margin: 0 auto; }
.wphh-cd .wphh-cd-empty-links a, .wphh-cd .wphh-cd-empty-links button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 0 16px;
    border: 1px solid var(--cd-line);
    border-radius: 12px;
    background: #ffffff;
    color: var(--cd-ink) !important;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none !important;
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease;
}
.wphh-cd .wphh-cd-empty-links a:hover, .wphh-cd .wphh-cd-empty-links button:hover { border-color: var(--cd-green); color: var(--cd-green-dark) !important; }
.wphh-cd .wphh-cd-empty-links i { color: var(--cd-green); font-size: 19px; }

/* loading */
.wphh-cd .wphh-cd-skel { grid-template-columns: 56px minmax(0, 1fr); }
.wphh-cd .wphh-cd-skel .wphh-cd-thumb, .wphh-cd .wphh-cd-skel .wphh-cd-info span {
    border: 0;
    background: linear-gradient(90deg, #f3f4f6 25%, #e8e9ed 50%, #f3f4f6 75%);
    background-size: 200% 100%;
    animation: wphh-cd-shimmer 1.2s linear infinite;
}
.wphh-cd .wphh-cd-skel .wphh-cd-info span { display: block; width: 72%; height: 13px; border-radius: 6px; }
.wphh-cd .wphh-cd-skel .wphh-cd-info span + span { width: 44%; margin-top: 8px; }
@keyframes wphh-cd-shimmer { to { background-position: -200% 0; } }
.wphh-cd .wphh-cd-spin { display: inline-block; animation: wphh-cd-turn 0.8s linear infinite; }
@keyframes wphh-cd-turn { to { transform: rotate(360deg); } }

/* totals + checkout */
.wphh-cd .wphh-cd-foot {
    flex-shrink: 0;
    padding: 14px 20px;
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--cd-line);
    background: #ffffff;
    box-shadow: 0 -10px 30px rgba(17, 24, 39, 0.06);
}
.wphh-cd .wphh-cd-totals { margin: 0 0 12px; }
.wphh-cd .wphh-cd-row { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; color: var(--cd-muted); font-size: 14px; }
.wphh-cd .wphh-cd-row dt { font-weight: 500; }
.wphh-cd .wphh-cd-row dd { margin: 0; color: var(--cd-ink); font-weight: 600; text-align: right; white-space: nowrap; }
.wphh-cd .wphh-cd-total { align-items: baseline; margin-top: 6px; padding-top: 10px; border-top: 1px solid var(--cd-line); color: var(--cd-ink); font-size: 16px; }
.wphh-cd .wphh-cd-total dt { font-weight: 700; }
.wphh-cd .wphh-cd-total dd { font-size: 21px; font-weight: 800; letter-spacing: -0.01em; }
.wphh-cd .wphh-cd-total small { color: var(--cd-muted); font-size: 12px; font-weight: 600; letter-spacing: 0; }
.wphh-cd .wphh-cd-recurring { margin: -6px 0 12px; color: var(--cd-muted); font-size: 12.5px; text-align: right; }
.wphh-cd .wphh-cd-checkout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 52px;
    border-radius: 12px;
    background: var(--cd-green);
    color: #ffffff !important;
    font-size: 16px;
    font-weight: 700;
    text-decoration: none !important;
    box-shadow: 0 10px 24px rgba(22, 163, 74, 0.28);
    transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.wphh-cd .wphh-cd-checkout:hover { background: var(--cd-green-dark); transform: translateY(-1px); box-shadow: 0 14px 30px rgba(22, 163, 74, 0.32); }
.wphh-cd .wphh-cd-viewcart {
    display: block;
    margin-top: 12px;
    color: var(--cd-ink) !important;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    text-decoration: underline !important;
    text-underline-offset: 3px;
}
.wphh-cd .wphh-cd-viewcart:hover { color: var(--cd-green-dark) !important; }

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

@media (max-width: 480px) {
    .wphh-cd .wphh-cd-panel { width: 100%; box-shadow: none; }
    .wphh-cd .wphh-cd-head { padding-left: 16px; }
    .wphh-cd .wphh-cd-body { padding-left: 16px; padding-right: 16px; }
    .wphh-cd .wphh-cd-foot { padding-left: 16px; padding-right: 16px; }
    .wphh-cd .wphh-cd-item { grid-template-columns: 48px minmax(0, 1fr) auto; gap: 12px; }
    .wphh-cd .wphh-cd-thumb { width: 48px; height: 48px; font-size: 22px; border-radius: 10px; }
}
@media (prefers-reduced-motion: reduce) {
    .wphh-cd .wphh-cd-panel, .wphh-cd .wphh-cd-overlay { transition: none; }
    .wphh-cd .wphh-cd-item.is-new, .wphh-cd .wphh-cd-skel .wphh-cd-thumb, .wphh-cd .wphh-cd-skel .wphh-cd-info span, .wphh-cd .wphh-cd-spin { animation: none; }
}

/* page while the drawer is open */
html.wphh-cd-lock, html.wphh-cd-lock body { overflow: hidden !important; }
html.wphh-cd-lock #tidio-chat { display: none !important; }

/* count badge the script adds to cart buttons that had none (cart was empty when the page loaded) */
.wphh-cd-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    z-index: 2;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    box-sizing: border-box;
    border-radius: 999px;
    background: #16a34a;
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    line-height: 20px;
    text-align: center;
    pointer-events: none;
}
