/* ==========================================================================
   BASE STYLES & RESET
   ========================================================================== */

*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
}

/* ==========================================================================
   LAYOUT CONTAINERS
   ========================================================================== */

.app-container {
    display: grid;
    grid-template-columns: 1fr;
    padding: 1rem;
    gap: 1.5rem;
    position: relative;
}

@media (min-width: 1024px) {
    .app-container {
        grid-template-columns: 1fr 350px;
    }
}

.main-content {
    min-width: 0;
}

/* ==========================================================================
   HEADER & NAVIGATION
   ========================================================================== */

.app-header-fixed {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1001;
    background-color: var(--card-bg);
    box-shadow: var(--shadow);
}

.top-nav {
    display: flex;
    align-items: center;
    min-height: 60px;
    padding: 0.5rem 1rem;
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

.logo {
    height: 40px;
    margin-right: auto;
    flex-shrink: 0;
}

/* Navigation Tabs */
.config-nav-tabs {
    display: flex;
    gap: 1rem;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.config-nav-tabs.hidden {
    display: none;
}

.config-nav-tabs button {
    background: none;
    border: none;
    font-size: 1rem;
    padding: 0.5rem 0;
    cursor: pointer;
    color: var(--text-color);
    border-bottom: 2px solid transparent;
    transition: color 0.2s;
    white-space: nowrap;
}

.config-nav-tabs button:hover {
    color: var(--primary-color);
}

.config-nav-tabs button.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    font-weight: 700;
}

/* Top Actions */
.top-actions {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
    margin-left: auto;
    flex-shrink: 0;
}

.top-actions-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 1rem;
}

/* Language Switcher */
.language-switcher {
    position: relative;
    display: flex;
    align-items: center;
}

.language-switcher-icon {
    cursor: pointer;
    color: var(--text-color);
}

.language-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background-color: var(--card-bg);
    border-radius: 4px;
    box-shadow: var(--shadow);
    list-style: none;
    margin: 0.5rem 0 0;
    padding: 0.5rem 0;
    z-index: 1002;
    min-width: 120px;
}

.language-dropdown.visible {
    display: block;
}

.language-dropdown a {
    display: block;
    padding: 0.5rem 1rem;
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.9rem;
    cursor: pointer;
}

.language-dropdown a:hover {
    background-color: var(--bg-color);
}

.language-dropdown a.active {
    font-weight: 700;
    color: var(--primary-color);
}
@media (max-width: 767px) {
    /* Mobile language dropdown positioning */
    .language-dropdown.visible {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        right: auto;
        z-index: 2100;
        min-width: 200px;
        max-width: 90vw;
        border-radius: 8px;
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    }
    
    /* Add backdrop for mobile */
    .language-dropdown.visible::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: -1;
    }
    
    .language-dropdown a {
        padding: 1rem;
        font-size: 1.1rem;
    }
}



/* Price Toggle */
.price-toggle-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.price-toggle {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.price-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 26px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: #fff;
    transition: 0.4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--primary-color);
}

input:checked + .slider:before {
    transform: translateX(24px);
}

.toggle-label {
    font-size: 0.9rem;
    white-space: nowrap;
    user-select: none;
}

/* Styles for new VAT input field */
.price-input-container {
    display: flex;
    align-items: center;
    gap: 8px;
}
.vat-input-field {
    width: 60px;
    padding: 4px 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    text-align: right;
}

/* ==========================================================================
   SEARCH
   ========================================================================== */

.search-header {
    display: flex;
    align-items: center;
    height: 60px;
    padding: 0 1rem;
    border-bottom: 1px solid var(--border-color);
}

.search-bar {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

.search-bar input {
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

/* ==========================================================================
   FILTERS & SORTING
   ========================================================================== */

.filter-sort-container {
    padding: 0.75rem 1rem;
    background-color: #f1f1f1;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    justify-content: center;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-group label {
    font-weight: 700;
    font-size: 0.9rem;
    color: #555;
}

.filter-group button {
    background-color: #fff;
    border: 1px solid #ccc;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.filter-group select {
    background-color: #fff;
    border: 1px solid #ccc;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='currentColor' class='bi bi-chevron-down' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    padding-right: 2rem;
}

.filter-group button:hover,
.filter-group select:hover {
    border-color: #999;
    background-color: #f8f8f8;
}

.filter-group button.active {
    background-color: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
    font-weight: 700;
}

/* ==========================================================================
   HEADER SLOT BAR (NEW)
   ========================================================================== */
#slot-bar-sticky-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1002; /* Higher than the main header */
    background-color: var(--card-bg);
    box-shadow: var(--shadow);
    display: none; /* Hidden by default, shown by JS */
}

#slot-bar-sticky-wrapper .slot-allocation-details {
    margin: 0;
    padding: 0.75rem 1rem;
    border: none;
    background: none;
}

@media (min-width: 768px) {
    #slot-bar-sticky-wrapper {
        display: none !important;
    }
}


/* ==========================================================================
   PRODUCT GRID & CARDS
   ========================================================================== */

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    justify-content: center;
}

.product-card {
    background-color: var(--card-bg);
    border-radius: 8px;
    box-shadow: var(--shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.15);
}

.product-card-img {
    width: 100%;
    height: 200px;
    object-fit: contain;
    background-color: #fff;
    padding: 10px;
}

.product-card-info {
    padding: 1rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-card-name {
    font-weight: 700;
    margin-bottom: 0.5rem;
    flex-grow: 1;
}

.product-card-model {
    font-size: 0.8rem;
    color: #6c757d;
    margin-bottom: 0.5rem;
}

.product-card-slots {
    font-size: 0.8rem;
    color: var(--primary-color);
    font-weight: 700;
}

.product-card-stock {
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.product-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.product-card-price {
    font-weight: 700;
    color: var(--primary-color);
}

/* Stock Status */
.stock-main.available,
.stock-secondary.available,
.stock-available {
    color: #28a745;
}

.stock-main.unavailable,
.stock-unavailable {
    color: #dc3545;
}

/* ==========================================================================
   PRODUCT DETAIL VIEW
   ========================================================================== */

.product-detail-view {
    display: block;
}

.back-button {
    display: inline-block;
    margin-bottom: 1rem;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 700;
}

.detail-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 768px) {
    .detail-layout {
        grid-template-columns: 1fr 1fr;
    }
}

/* Image Gallery */
.image-column {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

.main-image-container {
    width: 100%;
    aspect-ratio: 1/1;
    border: 1px solid var(--border-color);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #fff;
    border-radius: 8px;
}

.main-image-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.thumbnail-carousel {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.thumb-nav-btn {
    background: #f0f0f0;
    border: 1px solid #ccc;
    padding: 0.5rem;
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
    margin: 0 5px;
    border-radius: 4px;
}

.thumb-nav-btn:hover {
    background: #e0e0e0;
}

.thumbnail-strip-viewport {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.thumbnail-strip {
    display: flex;
    transition: transform 0.3s ease-in-out;
}

.thumbnail-item {
    flex-shrink: 0;
    width: 70px;
    height: 70px;
    margin: 0 5px;
    border: 2px solid transparent;
    cursor: pointer;
    opacity: 0.6;
    transition: all 0.3s;
    padding: 2px;
    box-sizing: border-box;
    background-color: #fff;
}

.thumbnail-item.active {
    border-color: var(--primary-color);
    opacity: 1;
}

.thumbnail-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Product Info */
.detail-info h1 {
    margin-top: 0;
}

.detail-info h1,
.detail-info p {
    word-break: break-word;
    overflow-wrap: break-word;
}

.detail-price {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 1rem 0;
}

.detail-stock-info {
    margin-top: 1rem;
    border-top: 1px solid #eee;
    padding-top: 1rem;
}

.stock-line {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.stock-label {
    font-weight: 700;
}

.stock-value {
    font-weight: 700;
}

.detail-add-btn {
    width: 100%;
    padding: 1rem;
    font-size: 1.2rem;
    font-weight: 700;
    margin-top: 1.5rem;
}

/* Specifications */
.specifications {
    width: 100%;
    max-width: 500px;
    margin-top: 2rem;
    border-top: 1px solid #eee;
    padding-top: 1rem;
}

.specifications h3 {
    margin-top: 0;
}

.spec-table {
    width: 100%;
    border-collapse: collapse;
}

.spec-table td {
    padding: 0.5rem;
    border-bottom: 1px solid #f0f0f0;
}

.spec-table tr:last-child td {
    border-bottom: none;
}

.spec-key {
    font-weight: 700;
    color: #555;
}

/* Downloads */
.detail-downloads {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.detail-downloads h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.download-links-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.download-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    text-decoration: none;
    color: var(--text-color);
    transition: background-color 0.2s, border-color 0.2s;
    font-weight: 500;
}

.download-link:hover {
    background-color: #e9ecef;
    border-color: #adb5bd;
}

.download-link svg {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
}

/* ==========================================================================
   SHOPPING CART
   ========================================================================== */

/* Default (mobile) state: hide the desktop cart */
.shopping-cart-desktop {
    display: none;
}

/* Desktop state: show and style the cart as a sticky sidebar */
@media (min-width: 1024px) {
    .shopping-cart-desktop {
        display: flex;
        position: sticky;
        top: 20px;
        max-height: calc(100vh - 40px);
        height: fit-content;
        pointer-events: none; /* Makes the container 'invisible' to the mouse */
    }

    .shopping-cart-desktop > * {
        pointer-events: auto;  /* Makes the content inside clickable again */
    }
}

.cart-container {
    background-color: var(--card-bg);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    max-height: calc(100vh - 40px);
    overflow: hidden;
}

.cart-header {
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.cart-items {
    flex: 1 1 auto;
    overflow-y: auto;
    margin: 1rem 0;
    min-height: 200px;
}

.cart-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    font-size: 0.9rem;
}

.cart-config-header {
    font-weight: 700;
    background-color: #f1f1f1;
    padding: 0.5rem;
    margin-top: 1rem;
    border-radius: 4px;
    flex-wrap: wrap;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.2s, background-color 0.2s;
    position: relative;
}

.cart-config-header:hover .cart-image-tooltip {
    display: block;
}

.cart-image-tooltip {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 10;
    margin-top: 5px;
    background: #fff;
    border: 1px solid var(--border-color);
    padding: 5px;
    border-radius: 4px;
    box-shadow: var(--shadow);
    pointer-events: none;
}

.cart-image-tooltip img {
    width: 100px;
    height: 100px;
    object-fit: contain;
    display: block;
}

.cart-config-header:hover {
    border-color: #ccc;
}

.cart-config-header.active-config {
    border-color: var(--primary-color);
    background-color: #fdf5f6;
}

.cart-item-indented {
    padding-left: 1.5rem;
}

.cart-item-name {
    flex-grow: 1;
}

.cart-item-price {
    font-weight: 500;
}

.remove-item-btn {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0 0.5rem;
}

.cart-footer {
    margin-top: auto;
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
    flex-shrink: 0;
    background: var(--card-bg);
}

.cart-total {
    display: flex;
    justify-content: space-between;
    font-weight: 700;
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.cart-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.cart-actions button {
    width: 100%;
}

/* Slot Allocation */
.slot-allocation-details {
    padding: 0.75rem;
    background-color: #f8f9fa;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    margin: 0.5rem 0;
    font-size: 0.85rem;
}

.slot-progress-bar-container {
    width: 100%;
    background-color: #e9ecef;
    border-radius: 4px;
    height: 10px;
    margin-top: 5px;
    overflow: hidden;
}

.slot-progress-bar {
    height: 100%;
    background-color: var(--primary-color);
    transition: width 0.3s ease-in-out;
}

.slot-progress-bar.full {
    background-color: #dc3545;
}

/* Mobile Cart & FAB */
.fab-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1002;
}

.mobile-cart-fab {
    position: relative;
    width: 60px;
    height: 60px;
    background-color: var(--primary-color);
    color: #fff;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: var(--shadow);
    z-index: 1002;
    cursor: pointer;
    border: none;
}

.mobile-cart-fab svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
}

.mobile-cart-fab .item-count {
    position: absolute;
    top: 0;
    right: 0;
    background-color: #dc3545;
    color: #fff;
    font-size: 0.8rem;
    font-weight: bold;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    line-height: 1;
}

.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    pointer-events: none;
}

.cart-overlay.visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.mobile-cart-drawer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 90vh;
    background-color: var(--bg-color);
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    transform: translateY(100%);
    transition: transform 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
    pointer-events: none;
}

/* MOBILE CART SCROLLING FIX */
.mobile-cart-drawer .cart-container {
    background-color: transparent;
    box-shadow: none;
    border-radius: 0;
    padding: 1rem;
    max-height: 100%;
}

.mobile-cart-drawer .cart-items {
    /* This is the key part: it allows the list to grow and scroll */
    flex: 1 1 auto;
    overflow-y: auto;
    min-height: 0; /* Allow it to be smaller if needed */
}

.mobile-cart-drawer .cart-footer {
    background-color: var(--bg-color);
}

.cart-overlay.visible .mobile-cart-drawer {
    transform: translateY(0);
    pointer-events: auto;
}

.mobile-cart-close-btn {
    background-color: #6c757d;
    color: #fff;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 700;
    margin-top: 0.5rem;
    display: none;
}

.mobile-cart-drawer .mobile-cart-close-btn {
    display: block;
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */

.btn-load-cart,
.add-to-cart-btn,
.checkout-btn,
.modal-actions .checkout-btn,
.add-new-trolley-btn,
.clear-cart-btn {
    background-color: var(--primary-color);
    color: #fff;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, background-color 0.2s;
    text-decoration: none;
    display: inline-block;
    vertical-align: middle;
    font-family: inherit;
    font-size: 0.9rem;
    line-height: 1.5;
    text-align: center;
}

.btn-load-cart:hover,
.add-to-cart-btn:hover,
.checkout-btn:hover,
.modal-actions .checkout-btn:hover,
.add-new-trolley-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.add-to-cart-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.clear-cart-btn {
    background-color: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.clear-cart-btn:hover {
    background-color: #f1f1f1;
}

/* ==========================================================================
   PAGINATION
   ========================================================================== */

.pagination-controls-wrapper {
    position: sticky;
    z-index: 999;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1rem;
    transform: translateY(-20px);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    pointer-events: none;
}

.pagination-controls-wrapper.visible {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.pagination-controls-wrapper.pagination-bottom {
    position: static;
    opacity: 1;
    visibility: visible;
    margin-top: 2rem;
    margin-bottom: 1rem;
    transition: none;
    z-index: 100;
    pointer-events: auto;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    background-color: rgba(255, 255, 255, 0.95);
    padding: 0.5rem 1rem;
    border-radius: 25px;
    box-shadow: var(--shadow);
    pointer-events: auto;
}

.pagination-btn {
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: background-color 0.2s;
    pointer-events: auto;
    z-index: 101;
}

.pagination-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.pagination-btn:hover:not(:disabled) {
    background-color: #5a252b;
}

.pagination-info {
    font-size: 0.9rem;
    font-weight: 500;
    min-width: 60px;
    text-align: center;
}

/* ==========================================================================
   MODALS & OVERLAYS
   ========================================================================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 3000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.modal-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
    max-width: 500px;
    width: 90%;
    text-align: center;
}

.modal-content h2 {
    margin-top: 0;
}

.modal-content input {
    width: 100%;
    padding: 0.75rem;
    margin: 1rem 0;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.modal-content .modal-text {
    margin: 1rem 0;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.modal-actions button {
    padding: 0.75rem 1.5rem;
}

.modal-close-btn {
    background-color: #6c757d;
    color: #fff;
    border: none;
}

.modal-error {
    color: #dc3545;
    font-size: 0.9rem;
    margin-top: 1rem;
    min-height: 1.2em;
}

/* ==========================================================================
   ERROR PAGE
   ========================================================================== */

.error-page {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100vh;
    text-align: center;
    padding: 20px;
}

.error-page img {
    max-width: 200px;
    margin-bottom: 20px;
}

.error-page pre {
    background: #ffebeb;
    border: 1px solid #ffcaca;
    color: #58151c;
    padding: 1rem;
    text-align: left;
    max-width: 800px;
    overflow-x: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* ==========================================================================
   UTILITY CLASSES
   ========================================================================== */

.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.mt-2 {
    margin-top: 2rem;
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */

@media (max-width: 767px) {
    /* Make header scroll with the page on mobile */
    .app-header-fixed {
        position: relative;
        box-shadow: none; /* Remove shadow from non-sticky header */
    }

    .top-nav {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: center;
        height: auto;
        padding: 0.5rem 1rem;
        min-height: 60px;
        position: relative;
        gap: 0.5rem 1rem;
    }

    .logo {
        order: 1;
        max-width: 160px;
        margin-right: auto;
    }

    .config-nav-tabs {
        position: static;
        transform: none;
        order: 4;
        margin-bottom: 0.5rem;
        flex-wrap: wrap;
        justify-content: center;
        flex-basis: 100%;
    }

    .config-nav-tabs button {
        font-size: 0.9rem;
        padding: 0.4rem 0.8rem;
    }

    .top-actions {
        display: contents;
    }

    .top-actions-buttons {
        display: contents;
    }

    .top-actions-buttons .btn-load-cart,
    .top-actions-buttons form {
        display: none;
    }

    .language-switcher {
        order: 2;
    }

    .price-toggle-container,
    .price-input-container {
        order: 3;
        flex-basis: 100%;
        justify-content: center;
    }

    .filter-sort-container {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-group {
        flex-wrap: wrap;
        justify-content: center;
    }

    .pagination-controls-wrapper {
        display: none;
    }

    .specifications-desktop {
        display: none;
    }

    /* --- START OF MOBILE-SPECIFIC CAROUSEL FIX --- */
    .thumbnail-carousel {
        justify-content: space-between;
    }

    .thumbnail-strip-viewport {
        flex: 0 0 80px; /* Do not grow, do not shrink, base width of 80px (70px item + 5px margin each side) */
        height: 70px;
    }
    /* --- END OF MOBILE-SPECIFIC CAROUSEL FIX --- */
}

@media (min-width: 768px) {
    .specifications-mobile {
        display: none;
    }
}

@media (min-width: 1024px) {
    .fab-container {
        display: none;
    }
}