/* Premium platform layer for U.C Hublogs marketplace */
:root {
    --premium-blue: #0f4c81;
    --premium-blue-2: #0b75bd;
    --premium-navy: #071d33;
    --premium-cyan: #22d3ee;
    --premium-green: #10b981;
    --premium-bg: #f5f8fc;
    --premium-surface: rgba(255, 255, 255, 0.86);
    --premium-border: rgba(126, 161, 196, 0.28);
    --premium-shadow: 0 20px 50px rgba(7, 29, 51, 0.12);
    --premium-shadow-soft: 0 10px 28px rgba(15, 76, 129, 0.1);
    --premium-radius: 8px;
    --premium-motion: 180ms ease;
}

:root.theme-dark {
    --text-primary: #e6edf6;
    --text-secondary: #9fb0c5;
    --bg-primary: #0a1726;
    --bg-secondary: #081421;
    --border-color: rgba(126, 161, 196, 0.22);
    --premium-bg: #081421;
    --premium-surface: rgba(11, 28, 48, 0.82);
    --premium-border: rgba(148, 190, 229, 0.2);
}

body.premium-shell,
.premium-shell {
    background:
        radial-gradient(circle at 14% 10%, rgba(34, 211, 238, 0.14), transparent 28rem),
        radial-gradient(circle at 86% 4%, rgba(15, 76, 129, 0.2), transparent 32rem),
        linear-gradient(180deg, var(--premium-bg), #eef4fb 45%, var(--premium-bg));
    color: var(--text-primary);
}

:root.theme-dark body.premium-shell {
    background:
        radial-gradient(circle at 14% 10%, rgba(34, 211, 238, 0.1), transparent 28rem),
        radial-gradient(circle at 86% 4%, rgba(11, 117, 189, 0.22), transparent 32rem),
        linear-gradient(180deg, #081421, #07111e);
}

.navbar,
.home-nav,
.plp-header {
    border-bottom: 1px solid var(--premium-border) !important;
    background: #ffffff !important;
    box-shadow: 0 3px 12px rgba(7, 29, 51, 0.06) !important;
}

:root.theme-dark .navbar,
:root.theme-dark .home-nav,
:root.theme-dark .plp-header {
    background: rgba(8, 20, 33, 0.82) !important;
}

.home-hero {
    position: relative;
    overflow: hidden;
}

.home-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(120deg, rgba(15, 76, 129, 0.94), rgba(7, 29, 51, 0.94)),
        repeating-linear-gradient(90deg, rgba(255,255,255,.08) 0 1px, transparent 1px 80px);
    z-index: -2;
}

.home-hero::after {
    content: "";
    position: absolute;
    width: 28rem;
    height: 28rem;
    right: -8rem;
    top: 4rem;
    background: radial-gradient(circle, rgba(34, 211, 238, 0.28), transparent 68%);
    z-index: -1;
    pointer-events: none;
}

.hero-panel,
.home-section,
.home-cta,
.product-filter-bar,
.product-category-block,
.dashboard-section,
.dash-summary-item,
.email-panel,
.admin-section,
.stat-card,
.analytics-card,
.activity-card {
    background: var(--premium-surface) !important;
    border: 1px solid var(--premium-border) !important;
    border-radius: var(--premium-radius) !important;
    box-shadow: var(--premium-shadow-soft);
    backdrop-filter: blur(16px) saturate(135%);
}

.btn,
.btn-buy,
.home-pill,
.auth-btn {
    border-radius: 8px !important;
    transition: transform var(--premium-motion), box-shadow var(--premium-motion), background var(--premium-motion), border-color var(--premium-motion);
}

.btn:hover,
.btn-buy:hover,
.home-pill:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 26px rgba(15, 76, 129, 0.2);
}

.btn-primary,
.btn-buy,
.home-pill {
    background: linear-gradient(135deg, var(--premium-blue), var(--premium-blue-2)) !important;
    color: #fff !important;
    border: 0 !important;
}

.btn-success {
    background: linear-gradient(135deg, var(--premium-green), #059669) !important;
    border: 0 !important;
    color: #fff !important;
}

.plp-container h1,
.container > h1 {
    background: linear-gradient(135deg, var(--premium-navy), var(--premium-blue));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

:root.theme-dark .plp-container h1,
:root.theme-dark .container > h1 {
    background: linear-gradient(135deg, #e6edf6, #7dd3fc);
    -webkit-background-clip: text;
    background-clip: text;
}

.category-tabs {
    display: flex;
    gap: 0.45rem;
    overflow-x: auto;
    padding-top: 0.75rem;
    scrollbar-width: thin;
}

.category-tabs button {
    flex: 0 0 auto;
    border: 1px solid var(--premium-border);
    background: rgba(255, 255, 255, 0.76);
    color: var(--text-secondary);
    border-radius: 999px;
    padding: 0.48rem 0.8rem;
    font-weight: 800;
    cursor: pointer;
    transition: all var(--premium-motion);
}

.category-tabs button.active,
.category-tabs button:hover {
    color: #fff;
    background: linear-gradient(135deg, var(--premium-blue), var(--premium-blue-2));
    border-color: transparent;
}

.products-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 0.85rem;
}

.product-card {
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: 58px 1fr;
    gap: 0.75rem;
    align-items: center;
    min-height: 158px;
    padding: 0.9rem;
    background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(248,251,255,.92));
    border: 1px solid rgba(126, 161, 196, 0.22);
    border-radius: 8px;
    box-shadow: 0 12px 28px rgba(7, 29, 51, 0.08);
    transition: transform var(--premium-motion), box-shadow var(--premium-motion), border-color var(--premium-motion);
}

:root.theme-dark .product-card {
    background: linear-gradient(180deg, rgba(12, 30, 50, .96), rgba(8, 20, 33, .92));
}

.product-card::before {
    content: "Digital";
    position: absolute;
    top: 0.6rem;
    right: 0.6rem;
    border-radius: 999px;
    background: rgba(15, 76, 129, 0.1);
    color: var(--premium-blue);
    padding: 0.18rem 0.48rem;
    font-size: 0.68rem;
    font-weight: 900;
}

.product-card:hover {
    transform: translateY(-4px);
    border-color: rgba(15, 76, 129, 0.35);
    box-shadow: var(--premium-shadow);
}

.product-icon {
    width: 58px;
    height: 58px;
    border-radius: 8px;
    overflow: hidden;
    background: linear-gradient(135deg, #e9f5ff, #ffffff);
    display: grid;
    place-items: center;
}

.product-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 260ms ease;
}

.product-card:hover .product-icon img {
    transform: scale(1.08);
}

.product-details,
.product-price,
.product-action {
    grid-column: 1 / -1;
}

.product-details {
    min-height: 52px;
}

.product-name {
    padding-right: 4.2rem;
}

.availability {
    color: var(--premium-green) !important;
    font-weight: 800;
}

.product-price {
    font-size: 1.1rem;
    font-weight: 900;
    color: var(--premium-blue);
}

.btn-buy,
.btn-out-of-stock {
    width: 100%;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-height: 42px;
    text-decoration: none;
}

.dash-balance-card {
    position: relative;
    overflow: hidden;
    box-shadow: var(--premium-shadow) !important;
}

.dash-balance-card::after {
    content: "";
    position: absolute;
    width: 18rem;
    height: 18rem;
    right: -8rem;
    top: -8rem;
    background: radial-gradient(circle, rgba(34, 211, 238, 0.28), transparent 70%);
}

.premium-analytics {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
    gap: 1rem;
    margin: 1rem 0 1.4rem;
}

.analytics-card,
.activity-card {
    padding: 1rem;
}

.analytics-card h2,
.activity-card h2 {
    margin-bottom: 0.35rem;
}

.analytics-card p {
    color: var(--text-secondary);
    margin: 0 0 0.9rem;
}

.mini-chart {
    height: 180px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    align-items: end;
    gap: 0.75rem;
    padding-top: 1rem;
}

.mini-chart div {
    height: 100%;
    display: grid;
    align-items: end;
    gap: 0.45rem;
}

.mini-chart span {
    display: block;
    height: var(--bar-height);
    min-height: 12px;
    border-radius: 8px 8px 3px 3px;
    background: linear-gradient(180deg, var(--premium-cyan), var(--premium-blue));
    box-shadow: 0 12px 22px rgba(15, 76, 129, 0.18);
    animation: barRise 700ms ease both;
}

.mini-chart small {
    text-align: center;
    color: var(--text-secondary);
    font-weight: 800;
}

.activity-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--premium-border);
}

.activity-row:last-child {
    border-bottom: 0;
}

.admin-chart-line {
    display: grid;
    gap: 0.7rem;
}

.admin-chart-line span {
    width: var(--line-width);
    min-width: 44px;
    height: 16px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--premium-blue), var(--premium-cyan));
    box-shadow: 0 8px 18px rgba(15, 76, 129, 0.18);
}

.orders-table,
.transactions-table,
.users-table {
    overflow-x: auto;
}

.orders-table table,
.transactions-table table,
.users-table table {
    border-collapse: separate;
    border-spacing: 0;
}

.orders-table tr,
.transactions-table tr,
.users-table tr {
    transition: background var(--premium-motion), transform var(--premium-motion);
}

.orders-table tbody tr:hover,
.transactions-table tbody tr:hover,
.users-table tbody tr:hover {
    background: rgba(15, 76, 129, 0.06);
}

.table-search {
    width: min(100%, 360px);
    margin: 0 0 0.75rem;
    border: 1px solid var(--premium-border);
    border-radius: 8px;
    padding: 0.65rem 0.75rem;
    background: rgba(255, 255, 255, 0.86);
}

.footer {
    background: linear-gradient(135deg, #071d33, #0f4c81) !important;
    color: rgba(255, 255, 255, 0.88) !important;
    border-top: 1px solid rgba(255,255,255,.12);
}

.footer a {
    color: #dff6ff !important;
}

.floating-support {
    position: fixed;
    z-index: 10020;
    border: 0;
    box-shadow: var(--premium-shadow);
}

.floating-support {
    right: 1rem;
    bottom: 5.4rem;
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--premium-green), #059669);
    color: #fff;
    font-weight: 900;
    text-decoration: none;
}

.floating-whatsapp-group {
    position: fixed;
    left: 1rem;
    bottom: 1.8rem;
    z-index: 10020;
    min-height: 52px;
    max-width: min(280px, calc(100vw - 2rem));
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    border-radius: 999px;
    padding: 0.72rem 1rem;
    background: linear-gradient(135deg, #25d366, #128c7e);
    color: #fff;
    font-size: 0.9rem;
    font-weight: 900;
    line-height: 1.15;
    text-decoration: none;
    box-shadow: var(--premium-shadow);
    transition: transform var(--premium-motion), box-shadow var(--premium-motion);
}

.floating-whatsapp-group:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 34px rgba(18, 140, 126, 0.28);
}

.floating-whatsapp-group i {
    flex: 0 0 auto;
    font-size: 1.25rem;
}

.floating-whatsapp-group span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.toast-stack {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 10030;
    display: grid;
    gap: 0.5rem;
}

.premium-toast {
    transform: translateY(-8px);
    opacity: 0;
    min-width: 220px;
    max-width: min(360px, calc(100vw - 2rem));
    border-radius: 8px;
    padding: 0.75rem 0.9rem;
    background: rgba(7, 29, 51, 0.94);
    color: #fff;
    box-shadow: var(--premium-shadow);
    transition: all 220ms ease;
}

.premium-toast.is-visible {
    transform: translateY(0);
    opacity: 1;
}

.premium-reveal {
    animation: premiumReveal 520ms ease both;
}

@keyframes premiumReveal {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes barRise {
    from {
        height: 0;
        opacity: 0.5;
    }
}

@media (max-width: 900px) {
    .premium-analytics,
    .dash-top {
        grid-template-columns: 1fr !important;
    }

    .products-list {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
}

@media (max-width: 640px) {
    .home-hero-inner,
    .plp-container,
    .container {
        padding-left: 0.85rem !important;
        padding-right: 0.85rem !important;
    }

    .product-card {
        min-height: 148px;
    }

    .floating-support {
        bottom: 9.2rem;
        right: 0.8rem;
    }

    .floating-whatsapp-group {
        left: 0.8rem;
        bottom: 5.2rem;
        min-height: 46px;
        max-width: min(250px, calc(100vw - 6.2rem));
        padding: 0.62rem 0.82rem;
        font-size: 0.78rem;
    }

    .toast-stack {
        left: 0.8rem;
        right: 0.8rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}

/* Responsive polish layer: keeps shared headers, product cards, and dense panels from overlapping. */
html {
    overflow-x: hidden;
}

body {
    overflow-x: clip;
}

img,
svg,
video {
    max-width: 100%;
}

.container,
.plp-container,
.home-hero-inner,
.header-content,
.nav-container {
    width: min(100%, 1280px);
}

.navbar {
    width: 100%;
}

.nav-container {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0.75rem;
    padding-inline: clamp(0.7rem, 2vw, 1.1rem);
}

.nav-logo {
    min-width: 0;
    justify-self: center;
    overflow: hidden;
}

.nav-logo img,
.logo-link img,
.drawer-brand img {
    display: block;
    max-width: clamp(128px, 42vw, 190px) !important;
    height: auto;
    max-height: 42px;
}

.nav-right-spacer {
    width: auto;
    min-width: 40px;
}

.nav-toggle,
.nav-profile-icon,
.profile-icon,
.drawer-close {
    flex: 0 0 auto;
}

.header-content {
    gap: 0.75rem;
    min-height: 64px;
}

.header-left,
.header-right,
.logo-link {
    min-width: 0;
}

.marketplace-page .plp-container {
    padding-top: clamp(1rem, 3vw, 2rem);
}

.product-filter-bar,
.product-category-block,
.dashboard-section,
.analytics-card,
.activity-card,
.dash-summary-item,
.product-detail {
    min-width: 0;
}

.filter-grid {
    grid-template-columns: minmax(0, 1.4fr) minmax(160px, 0.8fr) auto;
}

.filter-control,
.filter-action,
.filter-control input,
.filter-control select {
    min-width: 0;
}

.category-head-row {
    min-width: 0;
}

.category-title {
    min-width: 0;
    overflow-wrap: anywhere;
    line-height: 1.25;
}

.category-count {
    flex: 0 0 auto;
}

.products-list {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
    align-items: stretch;
}

.product-card {
    grid-template-columns: 60px minmax(0, 1fr);
    grid-template-areas:
        "icon details"
        "price price"
        "action action";
    align-content: start;
    min-width: 0;
    min-height: 0;
    row-gap: 0.8rem;
}

.product-card::before {
    content: none;
}

.product-icon {
    grid-area: icon;
    flex-shrink: 0;
}

.product-details {
    grid-area: details;
    grid-column: auto;
    min-width: 0;
    min-height: 0;
    align-self: center;
}

.product-name {
    padding-right: 0;
    overflow-wrap: anywhere;
    word-break: normal;
    line-height: 1.32;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.availability {
    overflow-wrap: anywhere;
    line-height: 1.35;
}

.product-price {
    grid-area: price;
    grid-column: auto;
    min-width: 0;
    text-align: left;
    overflow-wrap: anywhere;
    line-height: 1.25;
}

.product-action {
    grid-area: action;
    grid-column: auto;
    min-width: 0;
}

.btn,
.btn-buy,
.btn-out-of-stock,
.auth-btn {
    max-width: 100%;
    white-space: normal;
    text-align: center;
    line-height: 1.2;
}

.section-head {
    min-width: 0;
}

.section-head h2 {
    min-width: 0;
    overflow-wrap: anywhere;
}

.dash-top,
.premium-analytics,
.dash-summary-grid {
    min-width: 0;
}

.dash-balance-card,
.dash-summary-item {
    min-width: 0;
}

.dash-balance-card h1,
.dash-summary-item strong,
.activity-row strong {
    overflow-wrap: anywhere;
}

.dash-top-actions {
    flex-wrap: wrap !important;
}

.dash-top-actions .btn {
    flex: 1 1 150px;
    width: auto !important;
}

.activity-row {
    align-items: flex-start;
}

.activity-row span,
.activity-row strong {
    min-width: 0;
}

.product-detail-page .container {
    padding-top: 1rem;
}

.product-detail {
    display: grid;
    gap: 0.95rem;
    padding: clamp(1rem, 3vw, 1.6rem);
    overflow: hidden;
}

.product-detail h1 {
    margin: 0;
    text-align: left;
    font-size: clamp(1.35rem, 4vw, 2rem);
    line-height: 1.18;
    overflow-wrap: anywhere;
}

.product-detail .description,
.product-detail .price,
.product-detail .stock,
.product-detail .category,
.product-detail form,
.product-detail p {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
}

.product-detail .description {
    margin-bottom: 0.25rem;
}

.product-detail .price,
.product-detail .stock,
.product-detail .category {
    margin-bottom: 0;
}

.product-detail .category {
    width: fit-content;
    max-width: 100%;
    white-space: normal;
}

.product-detail form {
    display: grid;
    gap: 0.85rem;
}

.product-detail .form-group {
    margin-bottom: 0;
}

.product-detail .btn,
.product-back-btn {
    width: fit-content;
    min-width: min(100%, 180px);
}

.product-back-btn {
    margin-top: 1rem;
}

@media (min-width: 760px) {
    .products-list {
        grid-template-columns: 1fr;
    }

    .product-card {
        grid-template-columns: 66px minmax(0, 1fr) minmax(120px, auto) minmax(128px, auto);
        grid-template-areas: "icon details price action";
        align-items: center;
        min-height: 96px;
    }

    .product-price {
        text-align: right;
    }
}

@media (max-width: 760px) {
    .filter-grid {
        grid-template-columns: 1fr;
    }

    .filter-action .btn {
        width: 100%;
    }

    .category-head-row,
    .section-head {
        align-items: flex-start;
        flex-wrap: wrap;
    }
}

@media (max-width: 640px) {
    .nav-container {
        min-height: 58px;
    }

    .nav-logo img,
    .logo-link img {
        max-width: clamp(116px, 48vw, 168px) !important;
        max-height: 38px;
    }

    .header-content {
        min-height: 58px;
        padding-inline: 0.85rem;
    }

    .product-category-block {
        padding: 0.85rem;
    }

    .products-list {
        grid-template-columns: 1fr;
    }

    .product-card {
        grid-template-columns: 54px minmax(0, 1fr);
        padding: 0.85rem;
    }

    .product-icon {
        width: 54px;
        height: 54px;
    }

    .product-detail .btn,
    .product-back-btn {
        width: 100%;
    }

    .activity-row {
        flex-direction: column;
        gap: 0.25rem;
    }
}

@media (max-width: 420px) {
    .nav-container {
        gap: 0.45rem;
        padding-inline: 0.6rem;
    }

    .nav-profile-icon,
    .profile-icon {
        width: 34px;
        height: 34px;
    }

    .nav-toggle {
        padding: 0.45rem;
    }

    .product-card {
        grid-template-columns: 1fr;
        grid-template-areas:
            "icon"
            "details"
            "price"
            "action";
    }

    .product-icon {
        width: 48px;
        height: 48px;
    }
}
