:root {
    --td-profile-primary: #2563eb;
    --td-profile-secondary: #64748b;
    --td-profile-bg: #f8fafc;
    --td-profile-white: #ffffff;
    --td-profile-text: #1e293b;
    --td-profile-border: #e2e8f0;
    --td-profile-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

.td-profile-container {
    background: var(--td-profile-bg);
    min-height: 100vh;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

/* Header & Cover */
.td-profile-header {
    background: var(--td-profile-white);
    position: relative;
    padding-bottom: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.td-profile-cover {
    height: 350px;
    background-size: cover;
    background-position: center;
    background-color: #cbd5e1;
    position: relative;
}

.td-profile-cover::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.4), transparent);
}

.td-profile-meta-row {
    display: flex;
    align-items: flex-end;
    margin-top: -100px;
    position: relative;
    z-index: 10;
    gap: 2rem;
    padding-left: 1rem;
}

.td-profile-avatar-wrap {
    background: var(--td-profile-white);
    padding: 6px;
    border-radius: 50%;
    box-shadow: var(--td-profile-shadow);
}

.td-profile-avatar {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    display: block;
    object-fit: cover;
}

.td-profile-identity {
    padding-bottom: 1rem;
}

.td-profile-name {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--td-profile-text);
    margin: 0;
    letter-spacing: -0.025em;
}

.td-profile-title {
    font-size: 1.125rem;
    color: var(--td-profile-secondary);
    margin: 0.25rem 0 1rem;
    font-weight: 500;
}

.td-profile-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.td-badge-item {
    background: #eff6ff;
    color: #1e40af;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 1px solid #bfdbfe;
}

/* Navigation Tabs */
.td-profile-nav {
    background: var(--td-profile-white);
    border-bottom: 1px solid var(--td-profile-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.td-profile-tabs {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 2.5rem;
}

.td-profile-tabs li {
    padding: 1.25rem 0;
    font-weight: 600;
    color: var(--td-profile-secondary);
    cursor: pointer;
    position: relative;
    transition: color 0.2s;
    font-size: 0.95rem;
}

.td-profile-tabs li:hover {
    color: var(--td-profile-primary);
}

.td-profile-tabs li.active {
    color: var(--td-profile-primary);
}

.td-profile-tabs li.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--td-profile-primary);
    border-radius: 3px 3px 0 0;
}

/* Content Area */
.td-profile-content {
    padding-top: 3rem;
    padding-bottom: 5rem;
}

.td-tab-content {
    display: none;
    animation: fadeIn 0.4s ease-out;
}

.td-tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Grids */
.td-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.td-post-card {
    background: var(--td-profile-white);
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.td-post-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--td-profile-shadow);
}

.td-post-thumb img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.td-post-body {
    padding: 1.5rem;
}

.td-post-title {
    font-size: 1.25rem;
    margin: 0 0 0.5rem;
    font-weight: 700;
    line-height: 1.4;
}

.td-post-title a {
    color: var(--td-profile-text);
    text-decoration: none;
}

.td-post-meta {
    font-size: 0.875rem;
    color: var(--td-profile-secondary);
}

/* Bio Box */
.td-bio-box {
    background: var(--td-profile-white);
    padding: 3rem;
    border-radius: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.td-content-heading {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    color: var(--td-profile-text);
}

.td-rich-text {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #475569;
}

/* Responsive */
@media (max-width: 768px) {
    .td-profile-meta-row {
        flex-direction: column;
        align-items: center;
        text-align: center;
        margin-top: -80px;
        padding-left: 0;
    }

    .td-profile-name {
        font-size: 2rem;
    }

    .td-profile-tabs {
        gap: 1.5rem;
        overflow-x: auto;
        padding-bottom: 0.5rem;
    }

    .td-profile-tabs li {
        white-space: nowrap;
    }
}

/* Admin Dashboard Stats */
.td-admin-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.td-stat-card {
    background: var(--td-profile-white);
    padding: 2rem;
    border-radius: 1.25rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--td-profile-border);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.td-stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 700;
    color: var(--td-profile-secondary);
    margin-bottom: 0.5rem;
}

.td-stat-value {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--td-profile-primary);
    line-height: 1;
}

.td-stat-sub {
    font-size: 0.85rem;
    color: var(--td-profile-secondary);
    margin-top: 0.5rem;
}

.td-top-performers {
    align-items: stretch;
    text-align: left;
}

.td-mini-list {
    list-style: none;
    padding: 0;
    margin: 1rem 0 0;
}

.td-mini-list li {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.85rem;
}

.td-mini-list li:last-child {
    border: none;
}

.td-minimal-mode .td-profile-cover {
    height: 200px;
}

.td-minimal-mode .td-profile-meta-row {
    margin-top: -60px;
}

.td-minimal-mode .td-profile-avatar {
    width: 120px;
    height: 120px;
}

@media (max-width: 992px) {
    .td-admin-dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   STORE PRODUCTS — Adaptive Card Grid
============================================================ */

/* Base Grid */
.td-products-grid {
    display: grid;
    gap: 2rem;
}

/* 1 Product: Full-width showcase */
.td-products-grid.td-grid-single {
    grid-template-columns: 1fr;
    max-width: 600px;
    margin: 0 auto;
}

/* 2 Products: Side-by-side */
.td-products-grid.td-grid-double {
    grid-template-columns: repeat(2, 1fr);
}

/* 3+ Products: Standard 3-column grid */
.td-products-grid.td-grid-multi {
    grid-template-columns: repeat(3, 1fr);
}

/* Product Card */
@keyframes tdShake {
    0% { transform: translateX(0); }
    20% { transform: translateX(-4px) rotate(-1deg); }
    40% { transform: translateX(4px) rotate(1deg); }
    60% { transform: translateX(-4px) rotate(-1deg); }
    80% { transform: translateX(4px) rotate(1deg); }
    100% { transform: translateX(0); }
}

.td-product-card {
    background: var(--td-profile-white);
    border-radius: 1rem;
    overflow: hidden;
    border: 1px solid #cbcbd1;
    box-shadow: 4px 2px 17px 9px rgba(87, 131, 213, 0.48), -2px 5px 6px -2px rgb(0 0 0 / 72%);
    display: flex;
    flex-direction: column;
}

.td-product-card:hover {
    animation: tdShake 0.4s ease-in-out;
}

/* Product Image */
.td-product-thumb {
    position: relative;
    overflow: hidden;
    background: #f1f5f9;
}

.td-product-thumb img {
    width: 100%;
    height: 240px;
    object-fit: cover;
    display: block;
}

.td-product-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 240px;
    background: #f1f5f9;
}

.td-product-placeholder svg {
    width: 48px;
    height: 48px;
}

/* Badges */
.td-product-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    z-index: 2;
}

.td-badge-sale {
    background: #16a34a;
    color: #fff;
}

.td-badge-oos {
    background: #dc2626;
    color: #fff;
}

/* Product Body */
.td-product-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.td-product-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
    line-height: 1.4;
}

.td-product-title a {
    color: var(--td-profile-text);
    text-decoration: none;
    transition: color 0.2s;
}

.td-product-title a:hover {
    color: var(--td-profile-primary);
}

/* Price */
.td-product-price {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--td-profile-primary);
    margin-bottom: 1.25rem;
}

.td-product-price del {
    color: #94a3b8;
    font-weight: 500;
    font-size: 0.9rem;
    margin-right: 0.25rem;
}

.td-product-price ins {
    text-decoration: none;
}

/* Action Buttons */
.td-product-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: auto;
}

.td-btn-view,
.td-btn-cart {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.65rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    transition: all 0.2s ease;
    cursor: pointer;
}

.td-btn-view {
    background: #f1f5f9;
    color: var(--td-profile-text);
    border: 1px solid var(--td-profile-border);
}

.td-btn-view:hover {
    background: #e2e8f0;
    color: var(--td-profile-text);
}

.td-btn-cart {
    background: var(--td-profile-primary);
    color: #fff;
    border: 1px solid var(--td-profile-primary);
}

.td-btn-cart:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
    color: #fff;
}

/* No Products State */
.td-no-products {
    text-align: center;
    padding: 3rem;
    color: var(--td-profile-secondary);
    grid-column: 1 / -1;
}

/* Single product card: horizontal layout */
.td-grid-single .td-product-card {
    flex-direction: row;
}

.td-grid-single .td-product-thumb {
    width: 45%;
    flex-shrink: 0;
}

.td-grid-single .td-product-thumb img {
    height: 100%;
    min-height: 280px;
}

.td-grid-single .td-product-body {
    padding: 2rem;
    justify-content: center;
}

.td-grid-single .td-product-title {
    font-size: 1.5rem;
}

.td-grid-single .td-product-price {
    font-size: 1.5rem;
}

/* Responsive: Products */
@media (max-width: 992px) {
    .td-products-grid.td-grid-multi {
        grid-template-columns: repeat(2, 1fr);
    }

    .td-grid-single .td-product-card {
        flex-direction: column;
    }

    .td-grid-single .td-product-thumb {
        width: 100%;
    }
}

@media (max-width: 576px) {

    .td-products-grid.td-grid-double,
    .td-products-grid.td-grid-multi {
        grid-template-columns: 1fr;
    }
}