/* ==========================================================================
   1. GLOBAL CORE BLUEPRINT & RESET
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #121212; /* Dark Mode Canvas */
    color: #e0e0e0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.wrapper {
    flex: 1;
    padding: 20px;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
}

/* Status Notifications & Alerts */
.alert {
    padding: 12px;
    margin-bottom: 20px;
    border-radius: 4px;
    font-weight: 500;
    font-size: 0.95rem;
}
.alert-danger {
    background-color: #5c1d1d;
    color: #ff9999;
    border: 1px solid #7c2d2d;
}
.alert-success {
    background-color: #1d5c2b;
    color: #99ff99;
    border: 1px solid #2d7c3d;
}

/* Generic Utility Badges */
.brand-badge {
    display: inline-block;
    background-color: #2a2a2a;
    color: #ff3e3e;
    font-size: 0.75rem;
    font-weight: bold;
    padding: 4px 10px;
    border-radius: 4px;
    margin-bottom: 5px;
    border: 1px solid #ff3e3e;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ==========================================================================
   2. SITE COMPONENT LAYOUTS (HEADER & FOOTER)
   ========================================================================== */
.main-header {
    background-color: #1a1a1a;
    border-bottom: 2px solid #ff3e3e; /* Red racing stripe accent */
    padding: 15px 0;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.logo-container {
    display: inline-block;
}

.site-logo {
    height: 40px; /* Constrains logo bounds to prevent blowout layouts */
    display: block;
}

.navbar a, .user-menu a {
    color: #ffffff;
    text-decoration: none;
    margin-right: 20px;
    font-weight: 500;
    transition: color 0.2s ease;
}

.navbar a:hover, .user-menu a:hover {
    color: #ff3e3e;
}

.admin-badge {
    background-color: #ff3e3e;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: bold;
}

.main-footer {
    background-color: #1a1a1a;
    padding: 25px 0;
    text-align: center;
    font-size: 0.9rem;
    border-top: 1px solid #2d2d2d;
    margin-top: 40px;
}

.footer-container p {
    color: #888;
    margin-bottom: 10px;
}

.footer-links a {
    color: #ff3e3e;
    text-decoration: none;
    margin: 0 10px;
}

.footer-links a:hover {
    text-decoration: underline;
}

/* ==========================================================================
   3. SECURITY LAYER SYSTEMS (LOGIN & REGISTER)
   ========================================================================== */
.auth-container {
    max-width: 450px;
    margin: 60px auto;
    background-color: #1a1a1a;
    padding: 35px;
    border-radius: 8px;
    border: 1px solid #2d2d2d;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
}

.auth-container h2 {
    color: #fff;
    margin-bottom: 25px;
    font-size: 1.8rem;
    text-align: center;
}

.auth-form .form-group {
    margin-bottom: 20px;
}

.auth-form label {
    display: block;
    margin-bottom: 6px;
    color: #ccc;
    font-size: 0.9rem;
}

.auth-form input {
    width: 100%;
    padding: 11px;
    background-color: #2a2a2a;
    border: 1px solid #3d3d3d;
    color: #fff;
    border-radius: 4px;
    transition: border-color 0.2s;
}

.auth-form input:focus {
    border-color: #ff3e3e;
    outline: none;
}

.auth-btn {
    width: 100%;
    padding: 12px;
    background-color: #ff3e3e;
    border: none;
    color: #fff;
    font-weight: bold;
    font-size: 1rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
    margin-top: 10px;
}

.auth-btn:hover {
    background-color: #cc2a2a;
}

.auth-switch {
    margin-top: 20px;
    text-align: center;
    font-size: 0.9rem;
    color: #aaa;
}

.auth-switch a {
    color: #ff3e3e;
    text-decoration: none;
    font-weight: bold;
}

.auth-switch a:hover {
    text-decoration: underline;
}

/* ==========================================================================
   4. STOREFRONT ENTRANCE LANDING (INDEX HERO PANEL)
   ========================================================================== */
.hero-section {
    position: relative;
    height: 55vh;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-bottom: 40px;
    border-radius: 6px;
}

.hero-video {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    transform: translate(-50%, -50%);
    z-index: 1;
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.65);
    z-index: 2;
}

.hero-content {
    position: relative;
    z-index: 3;
    text-align: center;
    padding: 0 20px;
}

.hero-content h1 {
    font-size: 2.8rem;
    color: #fff;
    margin-bottom: 12px;
    letter-spacing: 2px;
    font-weight: 800;
}

.hero-content p {
    font-size: 1.2rem;
    color: #ccc;
}

.cta-btn {
    display: inline-block;
    padding: 12px 35px;
    background-color: #ff3e3e;
    color: #fff;
    text-decoration: none;
    font-weight: bold;
    border-radius: 4px;
    margin-top: 25px;
    transition: background-color 0.2s;
}

.cta-btn:hover {
    background-color: #cc2a2a;
}

/* ==========================================================================
   5. REUSEABLE PRODUCT SHOWCASE GRIDS (CATALOG CARDS)
   ========================================================================== */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

.product-card {
    background-color: #1a1a1a;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #2d2d2d;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s, border-color 0.2s;
}

.product-card:hover {
    transform: translateY(-4px);
    border-color: #3d3d3d;
}

.card-image img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    background-color: #121212;
}

.card-details {
    padding: 15px;
    text-align: center;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.card-details h3 {
    font-size: 1.1rem;
    color: #fff;
    margin: 8px 0;
    min-height: 2.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sku-text {
    font-size: 0.8rem;
    color: #666;
    margin-top: 2px;
}

.card-price {
    color: #ff3e3e;
    font-weight: bold;
    font-size: 1.2rem;
    margin: 10px 0;
}

.view-btn {
    display: block;
    width: 100%;
    padding: 10px;
    background-color: #2d2d2d;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    margin-top: auto;
    font-weight: 500;
    transition: background-color 0.2s;
}

.view-btn:hover {
    background-color: #ff3e3e;
}

.out-of-stock-btn {
    width: 100%;
    padding: 10px;
    background-color: #2a2a2a;
    color: #555;
    border: 1px solid #333;
    border-radius: 4px;
    cursor: not-allowed;
    margin-top: auto;
}

/* ==========================================================================
   6. DYNAMIC MARKETPLACE SYSTEM (SHOP SIDEBAR SPLIT)
   ========================================================================== */
.shop-layout {
    display: flex;
    gap: 30px;
    margin-top: 20px;
}

.filter-sidebar {
    flex: 0 0 280px;
    background-color: #1a1a1a;
    padding: 20px;
    border-radius: 6px;
    border: 1px solid #2d2d2d;
    height: fit-content;
    position: sticky;
    top: 20px;
}

.filter-sidebar h3 {
    margin-bottom: 20px;
    border-bottom: 2px solid #ff3e3e;
    padding-bottom: 5px;
    font-size: 1.2rem;
    color: #fff;
}

.catalog-display {
    flex: 1;
}

.filter-group {
    margin-bottom: 15px;
}

.filter-group label {
    display: block;
    font-size: 0.85rem;
    color: #aaa;
    margin-bottom: 6px;
}

.filter-group input, .filter-group select {
    width: 100%;
    padding: 10px;
    background-color: #2a2a2a;
    border: 1px solid #3d3d3d;
    color: #fff;
    border-radius: 4px;
}

.filter-btn {
    width: 100%;
    padding: 12px;
    background-color: #ff3e3e;
    border: none;
    color: #fff;
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
    margin-bottom: 10px;
    transition: background-color 0.2s;
}

.filter-btn:hover {
    background-color: #cc2a2a;
}

.clear-filters-btn {
    display: block;
    text-align: center;
    padding: 10px;
    background-color: #2d2d2d;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.9rem;
}

.clear-filters-btn:hover {
    background-color: #3d3d3d;
}

.no-results {
    grid-column: 1 / -1;
    text-align: center;
    color: #888;
    padding: 50px 0;
}

/* ==========================================================================
   7. INDIVIDUAL DEEP-DIVE INTERFACE (PRODUCT VIEW VIEWFINDER)
   ========================================================================== */
.product-detail-container {
    display: flex;
    gap: 40px;
    margin-top: 20px;
    background-color: #1a1a1a;
    padding: 30px;
    border-radius: 8px;
    border: 1px solid #2d2d2d;
}

.product-gallery-section {
    flex: 0 0 450px;
}

.main-display-image img {
    width: 100%;
    height: 400px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #3d3d3d;
    background-color: #121212;
}

.thumbnail-slider {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    overflow-x: auto;
    padding-bottom: 5px;
}

.thumb-box {
    width: 80px;
    height: 80px;
    border: 1px solid #3d3d3d;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    background-color: #121212;
    flex-shrink: 0;
    transition: border-color 0.2s;
}

.thumb-box:hover, .active-thumb {
    border-color: #ff3e3e;
}

.thumb-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-purchase-section {
    flex: 1;
}

.product-title {
    font-size: 2rem;
    color: #fff;
    margin: 10px 0;
}

.sku-meta, .weight-meta {
    font-size: 0.9rem;
    color: #888;
    margin-bottom: 6px;
}

.sku-meta span, .weight-meta span {
    color: #bbb;
}

.price-box {
    background-color: #121212;
    padding: 20px;
    border-radius: 6px;
    margin: 20px 0;
    border-left: 4px solid #ff3e3e;
}

.currency-label {
    font-size: 1.5rem;
    color: #ff3e3e;
    font-weight: bold;
}

.price-amount {
    font-size: 2.5rem;
    color: #fff;
    font-weight: bold;
}

.tax-inclusive-tag {
    display: block;
    font-size: 0.8rem;
    color: #666;
    margin-top: 2px;
}

.description-box h3 {
    color: #fff;
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.description-box p {
    color: #aaa;
    line-height: 1.6;
    font-size: 0.95rem;
}

.cart-action-panel {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #2d2d2d;
}

.quantity-selector {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.quantity-selector label {
    font-weight: 500;
}

.quantity-selector input {
    width: 75px;
    padding: 8px;
    background-color: #2a2a2a;
    border: 1px solid #3d3d3d;
    color: #fff;
    border-radius: 4px;
    text-align: center;
}

.stock-counter {
    font-size: 0.85rem;
    color: #ff3e3e;
    font-weight: 500;
}

.add-cart-btn {
    width: 100%;
    padding: 15px;
    background-color: #ff3e3e;
    border: none;
    color: #fff;
    font-size: 1.1rem;
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.add-cart-btn:hover {
    background-color: #cc2a2a;
}

.out-of-stock-banner {
    background-color: #2c1a1a;
    border: 1px solid #5c2424;
    padding: 15px;
    border-radius: 4px;
    text-align: center;
    color: #ff9999;
    font-weight: bold;
}

/* Fitment Ledger Structural Design Table */
.compatibility-ledger-wrapper {
    margin-top: 40px;
    background-color: #1a1a1a;
    padding: 30px;
    border-radius: 8px;
    border: 1px solid #2d2d2d;
}

.compatibility-ledger-wrapper h2 {
    color: #fff;
    font-size: 1.4rem;
}

.section-subtitle {
    color: #888;
    font-size: 0.9rem;
    margin-bottom: 25px;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.compatibility-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.compatibility-table th {
    background-color: #121212;
    color: #ff3e3e;
    padding: 14px 15px;
    font-size: 0.9rem;
    border-bottom: 2px solid #2d2d2d;
    text-transform: uppercase;
}

.compatibility-table td {
    padding: 14px 15px;
    border-bottom: 1px solid #2d2d2d;
    color: #ccc;
    font-size: 0.95rem;
}

.make-cell {
    font-weight: bold;
    color: #fff;
}

.year-badge {
    background-color: #2a2a2a;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.85rem;
    border: 1px solid #3d3d3d;
}

.verified-pill {
    color: #4cd137;
    font-size: 0.85rem;
    font-weight: bold;
}

.empty-table-row {
    text-align: center;
    color: #666 !important;
    font-style: italic;
    padding: 35px 0 !important;
}

/* ==========================================================================
   8. USER SHOPPING BAG ARCHITECTURE (CART MATRIX PAGES)
   ========================================================================== */
.cart-page-wrapper {
    margin-top: 20px;
}

.cart-page-wrapper h2 {
    color: #fff;
    margin-bottom: 25px;
    border-bottom: 2px solid #ff3e3e;
    padding-bottom: 8px;
}

.empty-cart-display {
    text-align: center;
    padding: 60px 20px;
    background-color: #1a1a1a;
    border-radius: 6px;
    border: 1px solid #2d2d2d;
}

.empty-cart-display p {
    color: #888;
    margin-bottom: 25px;
    font-size: 1.2rem;
}

.cart-layout-grid {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.cart-items-list {
    flex: 1;
}

.cart-summary-sidebar {
    flex: 0 0 360px;
    background-color: #1a1a1a;
    padding: 25px;
    border-radius: 6px;
    border: 1px solid #2d2d2d;
    position: sticky;
    top: 20px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.cart-item-row {
    display: flex;
    align-items: center;
    background-color: #1a1a1a;
    padding: 15px 20px;
    border-radius: 6px;
    margin-bottom: 15px;
    border: 1px solid #2d2d2d;
    gap: 20px;
}

.cart-item-img img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #3d3d3d;
    background-color: #121212;
}

.cart-item-details {
    flex: 1;
}

.cart-item-details h3 a {
    color: #fff;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 600;
}

.cart-item-details h3 a:hover {
    color: #ff3e3e;
}

.cart-sku {
    font-size: 0.8rem;
    color: #666;
    margin-top: 5px;
}

.cart-unit-price {
    font-size: 0.9rem;
    color: #aaa;
    margin-top: 3px;
}

.cart-item-qty input {
    width: 65px;
    padding: 6px;
    background-color: #2a2a2a;
    border: 1px solid #3d3d3d;
    color: #fff;
    border-radius: 4px;
    text-align: center;
}

.cart-item-total p {
    font-weight: bold;
    color: #fff;
    font-size: 1.1rem;
    width: 110px;
    text-align: right;
}

.trash-btn {
    background: none;
    border: none;
    color: #555;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 5px;
    transition: color 0.2s;
}

.trash-btn:hover {
    color: #ff3e3e;
}

/* Ledger Summary sidebar items */
.cart-summary-sidebar h3 {
    color: #fff;
    font-size: 1.2rem;
    margin-bottom: 20px;
    border-bottom: 1px solid #2d2d2d;
    padding-bottom: 10px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 14px;
    font-size: 0.95rem;
    color: #aaa;
}

.vat-charge {
    font-style: italic;
    color: #666;
}

.grand-total-row {
    margin-top: 25px;
    padding-top: 15px;
    border-top: 2px dashed #3d3d3d;
    color: #fff;
    font-size: 1.1rem;
}

.final-balance {
    color: #ff3e3e;
    font-size: 1.5rem;
    font-weight: bold;
}

.checkout-btn {
    display: block;
    width: 100%;
    text-align: center;
    padding: 14px;
    background-color: #ff3e3e;
    color: #fff;
    text-decoration: none;
    font-weight: bold;
    border-radius: 4px;
    margin-top: 20px;
    font-size: 1rem;
    transition: background-color 0.2s;
}

.checkout-btn:hover {
    background-color: #cc2a2a;
}

.continue-shopping-btn {
    display: block;
    text-align: center;
    margin-top: 15px;
    color: #888;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.continue-shopping-btn:hover {
    color: #fff;
}

/* ==========================================================================
   9. STANDALONE INSIGHT GALLERY LAYOUTS
   ========================================================================== */
.gallery-section {
    margin-top: 20px;
}

.page-title {
    font-size: 2rem;
    color: #fff;
    margin-bottom: 8px;
}

.page-subtitle {
    color: #888;
    font-size: 0.95rem;
    margin-bottom: 30px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
}

.gallery-item {
    background-color: #1a1a1a;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #2d2d2d;
    transition: transform 0.2s;
}

.gallery-item:hover {
    transform: translateY(-2px);
    border-color: #3d3d3d;
}

.gallery-image-wrapper img {
    width: 100%;
    height: 240px;
    object-fit: cover;
    display: block;
    background-color: #121212;
}

.gallery-info {
    padding: 20px;
}

.gallery-info h3 {
    margin-bottom: 8px;
    color: #fff;
    font-size: 1.2rem;
}

.gallery-info p {
    color: #aaa;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* ==========================================================================
   10. MEDIA QUERIES (RESPONSIVE GRAPH ADAPTABILITY)
   ========================================================================== */
@media (max-width: 992px) {
    .shop-layout, .cart-layout-grid, .product-detail-container {
        flex-direction: column;
    }
    .filter-sidebar, .cart-summary-sidebar, .product-gallery-section {
        flex: 1 1 auto;
        width: 100%;
        position: static;
    }
}

@media (max-width: 576px) {
    .hero-content h1 {
        font-size: 2rem;
    }
    .cart-item-row {
        flex-direction: column;
        text-align: center;
    }
    .cart-item-total p {
        text-align: center;
        width: auto;
    }
}