:root {
    --bg-color: #FAFAFA;
    --surface-color: #FFFFFF;
    --surface-hover: #F4F4F5;
    --text-primary: #111111;
    --text-secondary: #888888;
    --accent: #000000;
    --accent-hover: #333333;
    --border: #EAEAEA;
    --font-family: 'Proxima Nova', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-family);
    -webkit-font-smoothing: antialiased;
    padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px));
    overflow-x: hidden;
}

body.app-loading {
    overflow: hidden;
}

.app-loading-screen {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background:
        radial-gradient(circle at top, rgba(255, 255, 255, 0.92), rgba(250, 250, 250, 0.98) 55%),
        rgba(250, 250, 250, 0.98);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

body.app-loading .app-loading-screen {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.app-loading-screen__panel {
    width: min(320px, 100%);
    padding: 28px 24px;
    border: 1px solid rgba(17, 17, 17, 0.08);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 30px 60px rgba(17, 17, 17, 0.08);
    text-align: center;
}

.app-loading-screen__spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 16px;
    border-radius: 50%;
    border: 3px solid rgba(17, 17, 17, 0.1);
    border-top-color: var(--accent);
    animation: app-loading-spin 0.8s linear infinite;
}

.app-loading-screen__message {
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: var(--text-primary);
}

@keyframes app-loading-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Header & Nav */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: calc(20px + env(safe-area-inset-top, 0px)) 4% 20px 4%;
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto minmax(220px, 1fr);
    gap: 24px;
    align-items: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
    transition: all 0.3s ease;
}

header.scrolled {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.1rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-primary);
    justify-self: start;
    grid-column: 1;
    grid-row: 1;
}

.logo img {
    height: 24px;
    width: auto;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    justify-self: end;
    grid-column: 3;
    grid-row: 1;
}

/* Toggle Switch */
.work-mode-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
}

.work-mode-toggle .label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
    color: var(--text-primary);
}

.switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--surface-color);
    border: 1px solid var(--border);
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 2px;
    bottom: 2px;
    background-color: var(--text-secondary);
    transition: .4s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: var(--accent);
    border-color: var(--accent);
}

input:checked+.slider:before {
    transform: translateX(24px);
    background-color: white;
}

/* Auth / Profile */
.profile-btn {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.profile-avatar {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    background-color: var(--accent);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* Date Filter Bar - Floating Pill */
.kits-slider {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    margin-top: calc(72px + env(safe-area-inset-top, 0px));
    /* Clear the fixed header + safe area */
}

.kits-slider::-webkit-scrollbar {
    display: none;
}

.kits-slider {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.hero-billboard {
    flex: 0 0 100vw;
    width: 100vw;
    height: 85vh;
    min-height: 600px;
    max-height: 900px;
    position: relative;
    background-color: #000;
    display: flex;
    align-items: flex-end;
    padding: 0 4% 12vh 4%;
    scroll-snap-align: start;
}

.date-filter-bar {
    background: #FFFFFF;
    padding: 8px 12px 8px 25px;
    border: 1px solid var(--border);
    display: inline-flex;
    align-items: center;
    gap: 20px;
    position: relative;
    margin: 0;
    border-radius: 100px;
    z-index: 90;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.06);
    left: auto;
    transform: none;
    justify-self: center;
    grid-column: 2;
    grid-row: 1;
}

.date-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.date-filter-bar label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

.date-picker {
    height: 40px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    box-sizing: border-box;
    outline: none;
    cursor: pointer;
    accent-color: var(--accent);
}

/* Override Safari/WebKit Native Date Picker Internal Colors */
.date-picker::-webkit-datetime-edit-fields-wrapper {
    background: transparent;
}

.date-picker::-webkit-date-and-time-value {
    color: var(--text-primary);
}

.date-picker::-webkit-calendar-picker-indicator {
    cursor: pointer;
    filter: invert(24%) sepia(85%) saturate(7483%) hue-rotate(352deg) brightness(98%) contrast(92%);
    /* Approximates #dc2626 */
}

.filter-btn {
    height: 48px;
    padding: 0 24px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    background-color: var(--accent);
    color: white;
    border: none;
    border-radius: 100px;
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.filter-btn:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

/* Main Content Area */
main {
    padding: 20px 0 60px 0;
}

/* Category Rows */
.category-row {
    margin-bottom: 6vw;
}

.category-title {
    font-size: 1.8rem;
    font-weight: 800;
    margin: 0 4% 0.5em 4%;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.row-wrapper {
    padding: 0 4%;
    overflow: hidden;
}

.horizontal-scroll {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 12px;
    padding: 20px 0;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 0;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    cursor: grab;
}

.horizontal-scroll.active {
    cursor: grabbing;
    scroll-snap-type: none;
    /* Disable snap while dragging */
}

.horizontal-scroll.active .item-card {
    cursor: grabbing;
}

.horizontal-scroll::-webkit-scrollbar {
    display: none;
}

.horizontal-scroll {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Item Card */
.item-card {
    flex: 0 0 calc(100% / 6 - 15px);
    min-width: 220px;
    scroll-snap-align: start;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    border-radius: 8px;
    background: transparent;
}

.item-card:hover {
    transform: translateY(-8px);
    z-index: 10;
}

.item-card:hover .card-image-wrapper {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
}

.item-card:hover .card-image-wrapper img {
    transform: scale(1.05);
}

.item-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    background: #dc2626;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    z-index: 10;
    border: 1px solid var(--border);
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    pointer-events: auto;
}

.item-card.unavailable img {
    opacity: 0.5;
    filter: grayscale(100%);
}

.item-card.unavailable .card-info {
    opacity: 0.5;
}

.item-card.unavailable:hover {
    transform: none;
}

.card-image-wrapper {
    width: 100%;
    aspect-ratio: 1 / 1;
    background-color: #F4F4F5;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    transition: box-shadow 0.4s ease;
    padding: 20px;
}

.card-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    mix-blend-mode: multiply;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    user-select: none;
    -webkit-user-drag: none;
    pointer-events: none;
}

.quick-add-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.2s ease;
    z-index: 20;
    backdrop-filter: blur(2px);
}

.quick-add-btn {
    background: var(--text-primary);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transform: translateY(10px);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    pointer-events: auto;
}

.item-card:not(.unavailable):hover .quick-add-overlay {
    opacity: 1;
}

.item-card:not(.unavailable):hover .quick-add-btn {
    transform: translateY(0);
}

.quick-add-btn:hover {
    background: var(--accent);
    transform: scale(1.05) !important;
}

.card-info {
    padding: 15px 5px 5px 5px;
    display: flex;
    flex-direction: column;
}

.card-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-price {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-top: 4px;
    display: none;
}

/* Modal / Detail View Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 1000;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
    animation: fadeIn 0.3s ease-out;
}

.modal-content {
    background-color: #ffffff;
    color: #111111;
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    border-radius: 16px;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
}

.modal-close {
    position: absolute;
    top: 25px;
    right: 25px;
    background: #F4F4F5;
    border: none;
    color: #111;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.modal-close:hover {
    background: #EAEAEA;
    transform: scale(1.05);
}

.modal-hero {
    width: 100%;
    height: 400px;
    position: relative;
    background-color: #F4F4F5;
    padding: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-hero img {
    width: 100%;
    max-width: 500px;
    height: 100%;
    object-fit: contain;
    mix-blend-mode: multiply;
}

.modal-details {
    padding: 50px;
    position: relative;
    z-index: 2;
}

.modal-title {
    font-size: 3rem;
    margin-bottom: 5px;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #111111;
}

.modal-meta {
    font-size: 1rem;
    color: #666666;
    margin-bottom: 25px;
    font-weight: 500;
}

.unit-selector {
    margin-bottom: 30px;
}

.unit-selector h3 {
    font-size: 1.1rem;
    margin-bottom: 10px;
    font-weight: 600;
    color: #333333;
}

.unit-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
}

.unit-btn {
    background-color: transparent;
    border: 1px solid var(--border);
    color: #111111;
    padding: 16px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
    text-align: center;
}

.unit-btn:hover:not(:disabled):not(.selected) {
    border-color: var(--accent);
    background-color: var(--accent);
    color: white;
}

.unit-btn.selected {
    background-color: var(--accent);
    color: white !important;
    border-color: var(--accent);
    box-shadow: 0 4px 12px rgba(229, 9, 20, 0.2);
}

.unit-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: repeating-linear-gradient(45deg,
            rgba(0, 0, 0, 0.02),
            rgba(0, 0, 0, 0.02) 10px,
            rgba(0, 0, 0, 0) 10px,
            rgba(0, 0, 0, 0) 20px);
    border-color: #e5e5e5;
}

.add-to-cart-btn {
    width: 100%;
    padding: 16px;
    background-color: var(--accent);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    letter-spacing: 0.02em;
}

.add-to-cart-btn:hover:not(:disabled) {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.add-to-cart-btn:disabled {
    background-color: #EAEAEA;
    color: #A3A3A3;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* Suggested Items Section */
.suggested-section {
    margin-top: 30px;
    border-top: 1px solid var(--border);
    padding-top: 20px;
}

.suggested-section h3 {
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: var(--text-secondary);
}

.suggested-grid {
    display: flex;
    overflow-x: auto;
    gap: 15px;
    padding-bottom: 15px;
}

.suggested-card {
    flex: 0 0 160px;
    height: 160px;
    background: var(--surface-hover);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 15px;
    cursor: pointer;
    transition: transform 0.2s, border-color 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.suggested-card:hover {
    border-color: var(--text-secondary);
    transform: translateY(-2px);
}

.suggested-img {
    width: 100%;
    height: 90px;
    object-fit: contain;
    border-radius: 2px;
    margin-bottom: 12px;
    mix-blend-mode: multiply;
}

.suggested-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Bottom Tab Bar */
.bottom-tab-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 500;
    display: flex;
    justify-content: space-around;
    align-items: center;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    padding: 8px 0 calc(8px + env(safe-area-inset-bottom, 0px)) 0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.04);
}

.tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 12px;
    color: #999;
    transition: color 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.tab-item span {
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.tab-item.active {
    color: #dc2626;
}

.tab-item:active {
    transform: scale(0.92);
}

.tab-icon-wrapper {
    position: relative;
    display: inline-flex;
}

.tab-badge {
    position: absolute;
    top: -6px;
    right: -10px;
    background: #dc2626;
    color: white;
    font-size: 0.6rem;
    font-weight: 800;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    line-height: 1;
}

.tab-profile-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    color: inherit;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.01em;
}

.tab-profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.tab-profile-avatar.has-photo,
.tab-profile-avatar.has-initials {
    background: #e5e7eb;
    color: #374151;
}

.tab-item.active .tab-profile-avatar.has-initials {
    background: #fee2e2;
    color: #dc2626;
}

/* Tab View System */
.tab-view {
    display: none;
    padding-top: calc(96px + env(safe-area-inset-top, 0px));
    padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px));
    min-height: 100vh;
}

.tab-view.active {
    display: block;
}

#view-profile {
    padding-top: calc(80px + env(safe-area-inset-top, 0px) + 20px);
}

.view-page-content {
    padding: 24px 4%;
    max-width: 800px;
    margin: 0 auto;
}

.view-page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 20px;
}

.view-page-title {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 6px;
}

.view-page-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
    line-height: 1.5;
}

/* Kits Grid */
.kits-page-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.kit-grid-card {
    background: var(--surface-color);
    border-radius: 12px;
    border: 1px solid var(--border);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.kit-grid-card:active {
    transform: scale(0.97);
}

.kit-grid-card-image {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
}

.kit-grid-card-info {
    padding: 12px 14px;
}

.kit-grid-card-name {
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.kit-grid-card-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.kit-grid-card-avail {
    font-size: 0.75rem;
    margin-top: 6px;
    font-weight: 600;
}

/* Kit Detail Modal */
.kit-modal-content {
    max-width: 480px;
}

.kit-modal-hero {
    width: 100%;
    height: 200px;
    background-size: cover;
    background-position: center;
    border-radius: 12px 12px 0 0;
    position: relative;
}

.kit-modal-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.5;
}

.kit-items-heading {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    font-weight: 700;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.kit-items-checklist {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.kit-check-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.kit-check-row:last-child {
    border-bottom: none;
}

.kit-check-row input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: #dc2626;
    flex-shrink: 0;
    cursor: pointer;
}

.kit-check-row-info {
    flex: 1;
}

.kit-check-row-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.kit-check-row-category {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.kit-check-row-unavail {
    color: #ef4444;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Full-Page Cart */
.empty-cart-msg {
    color: var(--text-secondary);
    text-align: center;
    margin-top: 50px;
    line-height: 1.6;
}

.empty-cart-msg a {
    color: #dc2626;
    text-decoration: none;
    font-weight: 600;
}

.cart-footer-inline {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

/* Profile Page */
.profile-header-card {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 28px;
    padding: 20px;
    background: var(--surface-color);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.profile-display-name {
    font-size: 1.3rem;
    font-weight: 800;
    margin-bottom: 2px;
}

.profile-role-badge {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.profile-section-title {
    font-size: 1rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.profile-signout-btn {
    width: 100%;
    margin-top: 30px;
    padding: 12px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    transition: background 0.2s;
}

.profile-signout-btn:active {
    background: var(--surface-hover);
}

/* Cart Button & Slide-Out Panel */
.cart-fab {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background-color: var(--accent);
    color: white;
    border: none;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 500;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.cart-fab:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

#cart-count {
    position: absolute;
    top: 0px;
    right: 0px;
    background: #E50914;
    color: white;
    font-size: 0.75rem;
    font-weight: 800;
    min-width: 24px;
    height: 24px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.cart-panel {
    position: fixed;
    top: 0;
    right: -450px;
    width: 450px;
    height: 100vh;
    background-color: var(--surface-color);
    box-shadow: -20px 0 60px rgba(0, 0, 0, 0.05);
    z-index: 2000;
    transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    border-left: 1px solid var(--border);
}

.cart-panel.open {
    right: 0;
}

.cart-header {
    padding: 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.close-cart-btn {
    background: #F4F4F5;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #111;
    cursor: pointer;
    transition: all 0.2s;
}

.close-cart-btn:hover {
    background: #EAEAEA;
    transform: scale(1.05);
}

.clear-cart-text-btn {
    background: none;
    border: none;
    margin-right: 15px;
    margin-bottom: 5px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    font-weight: 500;
    transition: color 0.2s;
}

.clear-cart-text-btn:hover {
    color: #111;
    text-decoration: underline;
}

.cart-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.empty-cart-msg {
    color: var(--text-secondary);
    text-align: center;
    margin-top: 50px;
}

.cart-item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid var(--border);
}

.cart-item-details {
    flex: 1;
}

.cart-item-title {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.cart-item-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.remove-item-btn {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 5px;
}

.cart-footer {
    padding: 20px;
    border-top: 1px solid var(--border);
    background: var(--bg-color);
}

.cart-total-row {
    display: flex;
    justify-content: space-between;
    font-weight: 600;
    font-size: 1.1rem;
}

/* Global Primary Button */
.btn-primary {
    background-color: var(--accent);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    letter-spacing: 0.02em;
    padding: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.btn-primary:hover:not(:disabled) {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
}

.btn-primary:disabled {
    background-color: #EAEAEA;
    color: #A3A3A3;
    cursor: not-allowed;
}

/* Auth Overlay */
.auth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--bg-color);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.auth-box {
    background: var(--surface-color);
    padding: 50px;
    border-radius: 16px;
    text-align: center;
    max-width: 450px;
    width: 100%;
    border: 1px solid var(--border);
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.08);
}

.auth-box h1 {
    margin-bottom: 12px;
    color: var(--text-primary);
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.auth-box p {
    color: var(--text-secondary);
    margin-bottom: 24px;
    font-size: 0.9rem;
}

.auth-form {
    display: grid;
    gap: 10px;
    text-align: left;
}

.auth-name-group {
    display: grid;
    gap: 10px;
}

.auth-name-group[hidden] {
    display: none;
}

.auth-form label {
    color: var(--text-primary);
    font-size: 0.8rem;
    font-weight: 700;
}

.auth-form input {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #fff;
    color: var(--text-primary);
    font: inherit;
    padding: 12px 14px;
}

.auth-form input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.08);
    outline: none;
}

.auth-form-message {
    min-height: 20px;
    margin: 2px 0 4px !important;
    font-size: 0.82rem !important;
}

.auth-form-message[data-type="error"] {
    color: #B42318;
}

.auth-form-message[data-type="success"] {
    color: #067647;
}

.auth-form-message[data-type="info"] {
    color: var(--text-secondary);
}

.google-btn {
    background: white;
    color: black;
    border: 1px solid var(--border);
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    transition: background 0.2s;
}

.google-btn:hover {
    background: #e5e5e5;
}

.auth-secondary-btn {
    background: var(--surface);
    margin-top: 2px;
}

.auth-link-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font: inherit;
    font-size: 0.85rem;
    font-weight: 650;
    padding: 6px 0 0;
    text-align: center;
}

.auth-link-btn:hover {
    color: var(--text-primary);
}

/* Feature Billboard */
.hero-billboard {
    width: 100%;
    height: 60vh;
    min-height: 500px;
    position: relative;
    background-color: #000;
}

.hero-bg {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 30%;
    opacity: 0.5;
    /* Darken the image against the black background */
}

.hero-vignette {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to top, var(--bg-color) 0%, rgba(0, 0, 0, 0) 20%);
}

.hero-content {
    position: absolute;
    bottom: 10%;
    left: 4%;
    max-width: 450px;
    z-index: 10;
    padding: 30px;
    background: rgba(255, 255, 255, 0.85);
    /* Frosty translucent background */
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 10px;
    color: #111;
    line-height: 1.05;
}

.hero-desc {
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.5;
}

.hero-btns {
    display: flex;
    gap: 15px;
}

.hero-btn {
    padding: 16px 32px;
    border-radius: 100px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border: none;
    letter-spacing: 0.02em;
}

.hero-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.btn-white {
    background: white;
    color: black;
}

.btn-gray {
    background: rgba(109, 109, 110, 0.7);
    color: white;
}

/* JS Row Sliders */
.row-wrapper {
    position: relative;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    header {
        padding: calc(12px + env(safe-area-inset-top, 0px)) 4% 12px 4%;
        grid-template-columns: 1fr auto;
        gap: 10px 12px;
    }

    .logo {
        font-size: 0.8rem;
        gap: 6px;
        grid-column: 1;
        grid-row: 1;
    }

    .logo svg {
        height: 20px !important;
    }

    .header-controls {
        gap: 10px;
        grid-column: 2;
        grid-row: 1;
        justify-self: end;
    }

    .work-mode-toggle {
        font-size: 0.75rem;
        gap: 6px;
    }

    .work-mode-toggle::before {
        font-size: 0.75rem;
    }

    .switch {
        width: 40px;
        height: 20px;
    }

    .slider:before {
        height: 14px;
        width: 14px;
    }

    input:checked+.slider:before {
        transform: translateX(20px);
    }

    .date-filter-bar {
        grid-column: 1 / -1;
        grid-row: 2;
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        min-width: 0;
        max-width: none;
        box-sizing: border-box;
        padding: 10px 4%;
        border-radius: 0;
        gap: 8px;
        margin: 0 0 -12px 0;
        left: auto;
        transform: none;
        translate: none;
        background: #f3f4f6;
        border: 0;
        border-top: 1px solid var(--border);
        border-bottom: 1px solid var(--border);
        box-shadow: none;
        position: relative;
    }

    .date-filter-bar::before {
        content: "";
        position: absolute;
        inset: -1px -4vw;
        background: #f3f4f6;
        border-top: 1px solid var(--border);
        border-bottom: 1px solid var(--border);
        z-index: -1;
    }

    .date-group {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 5px;
    }

    .date-group.return-group {
        border-left: 1px solid var(--border);
        padding-left: 14px;
        margin-left: 4px;
    }

    .date-filter-bar label {
        font-size: 0.6rem;
    }

    .date-filter-bar .date-picker {
        font-size: 0.8rem;
        height: 28px;
    }

    .date-filter-bar label,
    #check-availability-btn {
        margin-left: 0 !important;
    }

    #check-availability-btn {
        grid-column: 1 / -1;
        width: 100%;
        margin-top: 6px;
    }

    .tab-view {
        padding-top: calc(128px + env(safe-area-inset-top, 0px));
    }

    .filter-btn {
        justify-content: center;
    }

    .kits-slider {
        margin-top: 60px;
    }

    .hero-billboard {
        height: 40vh;
        min-height: 400px;
    }

    .hero-content {
        max-width: 92%;
        padding: 16px;
        bottom: 12%;
    }

    .hero-title {
        font-size: 1.6rem;
    }

    .hero-desc {
        font-size: 0.85rem;
        margin-bottom: 12px;
    }

    .hero-btns {
        flex-direction: column;
        width: 100%;
        gap: 10px;
    }

    .hero-btn {
        justify-content: center;
        width: 100%;
    }

    .category-title {
        font-size: 1.2rem;
    }

    .horizontal-scroll {
        gap: 10px;
        padding: 15px 0;
    }

    .item-card {
        flex: 0 0 42%;
        min-width: 135px;
    }

    .card-image-wrapper {
        padding: 12px;
    }

    .card-info {
        padding: 10px 2px 5px 2px;
    }

    .card-title {
        font-size: 0.8rem;
    }

    .modal-content {
        flex-direction: column;
        width: 95%;
        height: 85vh;
        overflow-y: auto;
    }

    .modal-hero {
        width: 100%;
        height: 250px;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .modal-details {
        width: 100%;
        padding: 20px;
    }

    .modal-title {
        font-size: 1.5rem;
    }

    .unit-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }

    .cart-panel {
        width: 100%;
        right: -100%;
    }

    .cart-panel.open {
        right: 0;
    }
}
