/**
 * Tier1 Cabinet — Header account widget styles.
 * Shortcode: [t1c-account-info]
 */

.t1c-header-widget {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-family: inherit;
    flex-wrap: nowrap;
    justify-content: center;
    width: 100%;
}

/* Wallet balance */
.t1c-hw-wallet {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border: 1px solid #bbf7d0;
    border-radius: 6px;
    color: #166534;
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.15s;
    white-space: nowrap;
}

.t1c-hw-wallet:hover {
    background: #dcfce7;
    border-color: #86efac;
    color: #166534;
    text-decoration: none;
}

/* Balance wrapper with tooltip */
.t1c-hw-balance-wrap {
    position: relative;
    display: inline-flex;
    padding-bottom: 12px;
    margin-bottom: -12px;
}

/* Main balance chip */
.t1c-hw-link-bal {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 3px 7px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-weight: 600;
    white-space: nowrap;
    text-decoration: none;
    color: inherit;
    transition: all 0.15s;
    cursor: pointer;
}

.t1c-hw-link-bal:hover {
    background: #eef2ff;
    border-color: #667eea;
    text-decoration: none;
    color: inherit;
}

/* Tooltip dropdown — uses opacity+visibility for close delay */
.t1c-hw-tooltip {
    position: absolute;
    top: calc(100% + 2px);
    right: -8px;
    min-width: 280px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    padding: 10px 0;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s, visibility 0s 0.3s;
}

.t1c-hw-tooltip::before {
    content: '';
    position: absolute;
    top: -6px;
    right: 13px;
    width: 10px;
    height: 10px;
    background: #fff;
    border-left: 1px solid #e2e8f0;
    border-top: 1px solid #e2e8f0;
    transform: rotate(45deg);
}

.t1c-hw-balance-wrap:hover .t1c-hw-tooltip {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.15s, visibility 0s 0s;
}

/* Tooltip title */
.t1c-hw-tt-title {
    padding: 0 14px 4px;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.t1c-hw-tt-subtitle {
    padding: 0 14px 8px;
    font-size: 10px;
    color: #94a3b8;
    border-bottom: 1px solid #f1f5f9;
    margin-bottom: 4px;
}

/* Tooltip row */
.t1c-hw-tt-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 14px;
    font-size: 13px;
    color: #94a3b8;
}

.t1c-hw-tt-row.t1c-hw-tt-has {
    color: #1e293b;
}

.t1c-hw-tt-icon {
    font-size: 14px;
    width: 18px;
    text-align: center;
    flex-shrink: 0;
}

.t1c-hw-tt-label {
    flex: 1;
    white-space: nowrap;
    text-decoration: none;
    color: inherit;
    transition: text-decoration-color 0.15s;
}

a.t1c-hw-tt-label:hover {
    color: #667eea;
    text-decoration: none;
}

a.t1c-hw-tt-num:hover {
    color: #667eea;
    text-decoration: none;
}

.t1c-hw-tt-num {
    font-weight: 700;
    font-size: 14px;
    min-width: 20px;
    text-align: right;
    text-decoration: none;
    color: inherit;
}

a.t1c-hw-tt-num:hover {
    color: inherit;
}

.t1c-hw-tt-row.t1c-hw-tt-has .t1c-hw-tt-num {
    color: #16a34a;
}

.t1c-hw-tt-row.t1c-hw-tt-has a.t1c-hw-tt-num:hover {
    color: #16a34a;
}

/* Add-to-cart button in tooltip row */
.t1c-hw-tt-cart {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-size: 14px;
    text-decoration: none;
    color: #667eea;
    background: #f1f5f9;
    transition: all 0.15s;
    flex-shrink: 0;
    margin-left: 4px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.t1c-hw-tt-cart:hover {
    background: #667eea;
    border-color: #667eea;
    color: #fff;
    text-decoration: none;
}

.t1c-hw-tt-cart.t1c-adding {
    opacity: 0.5;
    pointer-events: none;
}

.t1c-hw-tt-cart.t1c-added {
    background: #16a34a;
    border-color: #16a34a;
    color: #fff;
}

/* Cart row wrapper */
.t1c-hw-tt-cart-wrap {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    margin-left: 4px;
}

/* Quantity popup */
.t1c-hw-qty-popup {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 2px;
}
.t1c-hw-qty-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border: none;
    border-radius: 4px;
    background: #e2e8f0;
    color: #334155;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    padding: 0;
    transition: background 0.12s;
}
.t1c-hw-qty-btn:hover {
    background: #cbd5e1;
}
.t1c-hw-qty-input {
    width: 36px;
    height: 22px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    padding: 0;
    -moz-appearance: textfield;
}
.t1c-hw-qty-input::-webkit-inner-spin-button,
.t1c-hw-qty-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.t1c-hw-qty-add {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 22px;
    border: none;
    border-radius: 4px;
    background: #16a34a;
    color: #fff;
    cursor: pointer;
    font-size: 13px;
    padding: 0;
    transition: background 0.12s;
}
.t1c-hw-qty-add:hover {
    background: #15803d;
}
.t1c-hw-qty-add.t1c-adding {
    opacity: 0.5;
    pointer-events: none;
}

/* Toast notification */
.t1c-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #1e293b;
    color: #fff;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 999999;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    transform: translateY(-20px);
    opacity: 0;
    transition: transform 0.3s, opacity 0.3s;
    display: flex;
    align-items: center;
    gap: 12px;
    pointer-events: auto;
    cursor: default;
}

.t1c-toast.t1c-toast-show {
    transform: translateY(0);
    opacity: 1;
}

.t1c-toast-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #93c5fd;
    text-decoration: none;
    font-weight: 600;
    white-space: nowrap;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    cursor: pointer;
    pointer-events: auto;
    transition: background 0.15s, color 0.15s;
}

.t1c-toast-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.2);
    text-decoration: none;
}

/* Icon */
.t1c-hw-icon {
    font-size: 14px;
    line-height: 1;
}

/* Value */
.t1c-hw-val {
    font-size: 13px;
    color: #1e293b;
}

/* Quick Order — standalone button */
.t1c-hw-quick-order {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    border: 1px solid #d97706;
    border-radius: 6px;
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    color: #78350f;
    transition: all 0.15s;
    white-space: nowrap;
}
.t1c-hw-quick-order:hover {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #451a03;
    text-decoration: none;
}
.t1c-hw-quick-order .t1c-hw-icon {
    font-size: 13px;
}

/* My Account wrapper with dropdown — padded for side hover zones */
.t1c-hw-account-wrap {
    position: relative;
    display: inline-flex;
    justify-content: center;
    padding: 8px;
    margin: -8px;
}

.t1c-hw-account {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 4px 14px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    color: #475569;
    transition: all 0.15s;
    white-space: nowrap;
    width: 100%;
}

.t1c-hw-account-name {
    font-size: 11px;
    font-weight: 400;
    color: #94a3b8;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.t1c-hw-account:hover {
    background: #e2e8f0;
    color: #1e293b;
    text-decoration: none;
}

/* Account dropdown menu — opacity+visibility for close delay */
.t1c-hw-account-menu {
    position: absolute;
    top: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    min-width: 190px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    padding: 6px 0;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s, visibility 0s 0.3s;
}

/* Arrow */
.t1c-hw-account-menu::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    margin-left: -5px;
    width: 10px;
    height: 10px;
    background: #fff;
    border-left: 1px solid #e2e8f0;
    border-top: 1px solid #e2e8f0;
    transform: rotate(45deg);
}

.t1c-hw-account-wrap:hover .t1c-hw-account-menu {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.15s, visibility 0s 0s;
}

.t1c-hw-menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    font-size: 13px;
    color: #334155;
    text-decoration: none;
    transition: background .12s;
    white-space: nowrap;
}

.t1c-hw-menu-item:hover {
    background: #f1f5f9;
    color: #1e293b;
    text-decoration: none;
}

.t1c-hw-menu-icon {
    font-size: 14px;
    width: 18px;
    text-align: center;
    flex-shrink: 0;
}

.t1c-hw-menu-sep {
    height: 1px;
    background: #f1f5f9;
    margin: 4px 0;
}

.t1c-hw-menu-email {
    padding: 4px 14px 4px 40px;
    font-size: 11px;
    color: #b0b8c4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.t1c-hw-menu-logout {
    color: #94a3b8;
}

.t1c-hw-menu-logout:hover {
    color: #dc2626;
    background: #fef2f2;
}

/* Quick order link (non-logged-in) */
.t1c-hw-quick-order {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 14px;
    background: transparent;
    color: #667eea;
    border: 1px solid #667eea;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    font-size: 13px;
    transition: all 0.15s;
    white-space: nowrap;
}

.t1c-hw-quick-order:hover {
    background: #667eea;
    color: #fff;
    text-decoration: none;
}

/* Login link */
.t1c-hw-login {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 14px;
    background: #667eea;
    color: #fff;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    font-size: 13px;
    transition: all 0.15s;
}

.t1c-hw-login:hover {
    background: #5a6fd6;
    color: #fff;
    text-decoration: none;
}

/* Webmaster header: force single row */
.t1c-hw-inline {
    flex-wrap: nowrap !important;
    white-space: nowrap;
}

/* ─── Webmaster header widget ─────────────────────────────── */

.t1c-hw-webmaster {
    gap: 6px;
}

.t1c-hw-wm-tasks {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 8px;
    text-decoration: none;
    color: #fff;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.2s;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.3);
}

.t1c-hw-wm-tasks:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    color: #fff;
    text-decoration: none;
}

.t1c-hw-wm-icon {
    font-size: 14px;
}

.t1c-hw-wm-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 5px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 11px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
}

.t1c-hw-wm-user {
    color: #64748b;
    font-size: 12px;
    padding: 0 4px;
}

.t1c-hw-wm-logout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    color: #94a3b8;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.15s;
    border: 1px solid #e2e8f0;
}

.t1c-hw-wm-logout:hover {
    color: #dc2626;
    border-color: #dc2626;
    background: #fef2f2;
    text-decoration: none;
}

/* Responsive */
@media (max-width: 768px) {
    .t1c-header-widget {
        gap: 4px;
        font-size: 12px;
    }

    .t1c-hw-wallet,
    .t1c-hw-link-bal {
        padding: 2px 5px;
        font-size: 11px;
    }

    .t1c-hw-icon {
        font-size: 12px;
    }

    .t1c-hw-tooltip {
        right: -10px;
        min-width: 240px;
    }
}
