@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    --color-primary: #dc2626; /* Premium Accent Red */
    --color-primary-hover: #b91c1c;
    --color-neutral-dark: #0f172a;
    --color-neutral-light: #f8fafc;
}

body {
    font-family: var(--font-body);
    background-color: var(--color-neutral-light);
    color: var(--color-neutral-dark);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
}

/* Glassmorphism Styles */
.glass-nav {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(241, 245, 249, 0.8);
}

.glass-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(226, 232, 240, 0.5);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.02);
}

/* Premium Soft Shadows */
.soft-shadow-sm {
    box-shadow: 0 2px 8px -1px rgba(0, 0, 0, 0.02), 0 1px 3px -1px rgba(0, 0, 0, 0.01);
}

.soft-shadow {
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.02), 0 8px 16px -6px rgba(0, 0, 0, 0.02);
}

.soft-shadow-lg {
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.04), 0 10px 20px -8px rgba(0, 0, 0, 0.03);
}

/* Hover Micro-animations */
.hover-lift {
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-lift:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px -5px rgba(0, 0, 0, 0.04), 0 8px 20px -6px rgba(0, 0, 0, 0.03);
}

/* Responsive Table Styles (For wholesale style lists) */
.wholesale-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 0.45rem;
}

.wholesale-table thead {
    background-color: transparent;
}

.wholesale-table th {
    font-family: var(--font-heading);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.68rem;
    letter-spacing: 0.12em;
    color: #64748b;
    padding: 0.75rem 1rem;
    border: none;
}

.wholesale-table td {
    padding: 0.75rem 1rem;
    vertical-align: middle;
    background: #ffffff;
    border: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.wholesale-table tbody tr {
    border-radius: 0.9rem;
    box-shadow: 0 6px 16px -16px rgba(15, 23, 42, 0.18);
}

.wholesale-table tbody tr:hover td {
    transform: translateY(-1px);
}

.wholesale-table tbody tr td:first-child {
    border-top-left-radius: 1.5rem;
    border-bottom-left-radius: 1.5rem;
}

.wholesale-table tbody tr td:last-child {
    border-top-right-radius: 1.5rem;
    border-bottom-right-radius: 1.5rem;
}

.serial-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 9999px;
    background: #f8fafc;
    color: #64748b;
    font-size: 0.68rem;
    font-weight: 700;
}

.product-thumb {
    width: 3rem;
    height: 3rem;
    border-radius: 1rem;
    object-fit: cover;
    background: #f8fafc;
}

.device-pill-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    max-width: 20rem;
}

.device-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.3rem 0.55rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #334155;
    font-size: 0.68rem;
    font-weight: 700;
    border-radius: 9999px;
    line-height: 1.1;
    white-space: normal;
    max-width: 100%;
    word-break: break-word;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.35rem 0.7rem;
    border-radius: 9999px;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.status-out {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.status-low {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

.status-in {
    background: #ecfdf5;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.action-row {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem;
    white-space: nowrap;
}

.action-form {
    display: inline-block;
    margin-right: 0.5rem;
}

.buy-now-btn {
    display: inline-block;
    vertical-align: middle;
    line-height: 1;
    padding: 0.55rem 0.75rem;
    background: #dc2626;
    color: #ffffff;
    font-size: 0.65rem;
    font-weight: 800;
    border-radius: 1rem;
    border: none;
    min-width: 6rem;
    box-shadow: 0 10px 24px -14px rgba(220, 38, 38, 0.5);
    transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.buy-now-btn:hover {
    background: #b91c1c;
    transform: translateY(-1px);
    box-shadow: 0 12px 26px -14px rgba(220, 38, 38, 0.6);
}

.add-cart-btn {
    display: inline-block;
    vertical-align: middle;
    line-height: 1;
    padding: 0.65rem 0.9rem;
    background: #f8fafc;
    color: #0f172a;
    font-size: 0.72rem;
    font-weight: 800;
    border-radius: 1rem;
    border: 1px solid #e2e8f0;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.add-cart-btn:hover {
    background: #f1f5f9;
    color: #dc2626;
    transform: translateY(-1px);
}

.sold-out-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0.7rem;
    background: #f8fafc;
    color: #94a3b8;
    font-size: 0.65rem;
    font-weight: 800;
    border-radius: 9999px;
    border: 1px solid #e2e8f0;
}

/* Dynamic scroll highlighted row styling */
.highlight-row {
    animation: highlightFade 4s ease-out forwards;
}

@keyframes highlightFade {
    0% {
        background-color: #fef2f2;
        border-color: #f87171;
        box-shadow: inset 0 0 0 2px rgba(239, 68, 68, 0.2);
    }
    100% {
        background-color: transparent;
        border-color: #f1f5f9;
        box-shadow: none;
    }
}

.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.no-scrollbar::-webkit-scrollbar {
    display: none;
}

/* Top announcement bar */
.announcement-bar {
    line-height: 1.4;
}
.announcement-bar .announcement-full {
    display: none;
}
.announcement-bar .announcement-short {
    display: inline;
}
@media (min-width: 640px) {
    .announcement-bar .announcement-full {
        display: inline;
    }
    .announcement-bar .announcement-short {
        display: none;
    }
}

/* Shared responsive data-table (cart, orders, etc.) */
.responsive-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.responsive-table thead th {
    font-family: var(--font-heading);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.65rem;
    letter-spacing: 0.1em;
    color: #64748b;
}

.responsive-table tbody td {
    vertical-align: middle;
}

@media (max-width: 768px) {
    .responsive-table thead {
        display: none;
    }

    .responsive-table tbody tr {
        display: block;
        margin-bottom: 1rem;
        border: 1px solid #f1f5f9;
        border-radius: 1.25rem;
        overflow: hidden;
        box-shadow: 0 8px 18px -14px rgba(15, 23, 42, 0.12);
    }

    .responsive-table tbody tr td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 0.75rem;
        width: 100%;
        padding: 0.85rem 1rem;
        border-bottom: 1px solid #f8fafc;
        text-align: right !important;
    }

    .responsive-table tbody tr td:last-child {
        border-bottom: none;
    }

    .responsive-table tbody tr td[data-label]::before {
        content: attr(data-label);
        flex-shrink: 0;
        font-size: 0.65rem;
        color: #64748b;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.08em;
        text-align: left;
    }

    .responsive-table tbody tr td[data-label=""]::before,
    .responsive-table tbody tr td:not([data-label])::before {
        display: none;
    }
}

/* Mobile toast positioning */
@media (max-width: 640px) {
    #app-toast {
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
    }
}

@media (max-width: 768px) {
    .glass-nav .nav-main-row {
        flex-wrap: wrap;
        align-items: center;
        gap: 0.5rem;
        min-height: auto;
        height: auto;
        padding: 0.5rem 0;
    }

    .glass-nav .nav-main-row > form {
        order: 3;
        flex: 1 1 100%;
        width: 100%;
        max-width: 100%;
        margin-left: 0;
        margin-right: 0;
    }

    .glass-nav .nav-main-row > .nav-actions {
        order: 2;
        margin-left: auto;
    }
}

/* Tap-open nav dropdowns */
.nav-dropdown.is-open .nav-dropdown-menu {
    opacity: 1 !important;
    visibility: visible !important;
}

@media (max-width: 1023px) {
    .nav-dropdown-menu {
        position: fixed;
        left: 1rem;
        right: 1rem;
        top: auto;
        width: auto;
        margin-top: 0.5rem;
    }
}

/* Horizontal scroll category tabs */
.category-tabs-scroll {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.5rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.25rem;
}

.category-tabs-scroll a {
    flex-shrink: 0;
}

/* Homepage rate table mobile cards */
@media (max-width: 640px) {
    .rate-table thead {
        display: none;
    }

    .rate-table tbody tr {
        display: block;
        margin-bottom: 0.75rem;
        padding: 1rem;
        background: rgba(51, 65, 85, 0.35);
        border-radius: 1rem;
        border: 1px solid rgba(71, 85, 105, 0.4);
    }

    .rate-table tbody tr td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.35rem 0;
        border: none;
    }

    .rate-table tbody tr td:first-child {
        font-size: 0.875rem;
        margin-bottom: 0.5rem;
        padding-bottom: 0.5rem;
        border-bottom: 1px solid rgba(71, 85, 105, 0.35);
    }

    .rate-table tbody tr td:not(:first-child)::before {
        content: attr(data-label);
        font-size: 0.65rem;
        color: #94a3b8;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.06em;
    }
}

/* Wishlist card actions stack on small screens */
@media (max-width: 400px) {
    .wishlist-card-actions {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }

    .wishlist-card-actions a,
    .wishlist-card-actions form,
    .wishlist-card-actions button {
        width: 100%;
        justify-content: center;
    }
}

/* Smooth anchor scroll with sticky header offset */
html {
    scroll-behavior: smooth;
}

.scroll-mt-24 {
    scroll-margin-top: 6rem;
}

/* Page section spacing on mobile */
@media (max-width: 640px) {
    .page-section {
        padding-top: 2rem;
        padding-bottom: 2rem;
    }

    .empty-state-card {
        padding: 2.5rem 1.25rem !important;
    }
}

@media (max-width: 768px) {
    .wholesale-table thead {
        display: none;
    }

    .wholesale-table tbody tr {
        display: block;
        margin-bottom: 0.85rem;
        border-radius: 1.25rem;
        box-shadow: 0 8px 18px -14px rgba(15, 23, 42, 0.18);
    }

    .wholesale-table tbody tr td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        text-align: left !important;
        padding: 0.75rem 0.9rem;
        border: none;
    }

    .wholesale-table tbody tr td[data-label]::before {
        content: attr(data-label);
        display: inline-block;
        font-size: 0.65rem;
        color: #64748b;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.08em;
        margin-right: 0.6rem;
    }

    .wholesale-table tbody tr td:first-child {
        border-radius: 1.25rem 1.25rem 0 0;
    }
    .wholesale-table tbody tr td:last-child {
        border-radius: 0 0 1.25rem 1.25rem;
    }

    .wholesale-table tbody tr td .device-pill-group {
        justify-content: flex-start;
    }

    .wholesale-table tbody tr td .action-row {
        width: 100%;
        justify-content: flex-end;
    }

    .wholesale-table tbody tr td[data-label="Actions"] {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }

    .wholesale-table tbody tr td[data-label="Actions"] .action-row {
        flex-direction: column;
        align-items: stretch;
    }

    .wholesale-table tbody tr td[data-label="Actions"] .action-form,
    .wholesale-table tbody tr td[data-label="Actions"] .buy-now-btn,
    .wholesale-table tbody tr td[data-label="Actions"] .add-cart-btn {
        width: 100%;
        text-align: center;
    }

    /* Category header stacks cleanly */
    .category-header-title {
        font-size: 1.5rem;
        line-height: 1.25;
    }
}

@media (max-width: 480px) {
    .glass-nav nav > div {
        height: auto;
        min-height: 3.5rem;
        padding: 0.5rem 0;
    }

    .nav-search-input {
        padding-right: 2.75rem !important;
        font-size: 0.8125rem;
    }

    .nav-search-btn {
        padding-left: 0.65rem;
        padding-right: 0.65rem;
    }

    .nav-search-btn-text {
        display: none;
    }

    .buy-now-btn {
        min-width: auto;
        width: 100%;
    }

    .wholesale-table tbody tr td[data-label="Compatible Devices"] {
        flex-direction: column;
        align-items: flex-start;
    }

    .wholesale-table tbody tr td[data-label="Compatible Devices"]::before {
        margin-bottom: 0.35rem;
    }
}

/* Custom scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #f8fafc;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}
