/* Products Section */
.products-section {
    padding: 100px 0 80px;
    background: linear-gradient(135deg, #0f0f0f 0%, #1a1a1a 100%);
    color: #fff;
    position: relative;
    overflow: hidden;
    min-height: 100vh;
}

/* Product Cards */
.product-card {
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
    border-color: #dc3545;
}

.product-card .card-body {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-card .card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.product-card .card-text {
    color: #adb5bd;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.product-card .price {
    font-size: 1.25rem;
    font-weight: 700;
    color: #dc3545;
    margin-bottom: 1rem;
}

/* Badges */
.badge {
    font-weight: 500;
    padding: 0.35em 0.65em;
    font-size: 0.75em;
}

/* Loading Indicators */
#loadingIndicator {
    transition: opacity 0.3s ease;
}

#loadingIndicator.fade-out {
    opacity: 0;
    pointer-events: none;
}

.spinner-border {
    width: 3rem;
    height: 3rem;
    border-width: 0.25em;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .product-card .card-body {
        padding: 1rem;
    }
    
    .nav-tabs .nav-link {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
}

/* Modal Styles */
.modal-content {
    border: 1px solid #333;
}

.modal-header {
    border-bottom: 1px solid #333;
}

.modal-footer {
    border-top: 1px solid #333;
}

.form-control, .form-select {
    background-color: #1e1e1e;
    border: 1px solid #333;
    color: #fff;
}

.form-control:focus, .form-select:focus {
    background-color: #2a2a2a;
    border-color: #dc3545;
    color: #fff;
    box-shadow: 0 0 0 0.25rem rgba(220, 53, 69, 0.25);
}

.form-control::placeholder {
    color: #6c757d;
}

/* Tab Navigation */

/* Featured Products Section */
#featured-products {
    background-color: #000000 !important;
    padding: 4rem 0;
}

#featured-products .section-title {
    color: #fff;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    position: relative;
    display: inline-block;
}

#featured-products .section-title::after {
    content: '';
    position: absolute;
    width: 50px;
    height: 3px;
    background: #dc3545;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
}

/* Swiper Container */
.featured-products-swiper {
    padding: 2rem 1rem 4rem !important;
    width: 100%;
}

/* Swiper Wrapper - Fix centering */
.featured-products-swiper .swiper-wrapper {
    display: flex;
    align-items: stretch;
    justify-content: center;
}

/* Swiper Slide */
.featured-products-swiper .swiper-slide {
    height: auto;
    display: flex;
    justify-content: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Ensure cards fill the slide properly */
.featured-products-swiper .swiper-slide .card {
    width: 100%;
    max-width: 100%;
}

/* Tab Styles */
.nav-tabs {
    border-bottom: 1px solid #333;
    margin-bottom: 0;
}

.nav-tabs .nav-link {
    color: #fff;
    background-color: #1e1e1e;
    border: 1px solid #333;
    border-bottom: none;
    margin-right: 5px;
    border-radius: 0.25rem 0.25rem 0 0;
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.nav-tabs .nav-link:hover {
    border-color: #333;
    color: #dc3545;
    background-color: #2a2a2a;
}

.nav-tabs .nav-link.active {
    color: #fff;
    background-color: #dc3545;
    border-color: #333;
    border-bottom-color: transparent;
}

/* Filter Styles */
#rimSizeFilter {
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: #1e1e1e;
    color: #fff;
    border: 1px solid #333;
}

#rimSizeFilter:focus {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.25rem rgba(220, 53, 69, 0.25);
}

/* Tab Content */
.tab-content {
    background-color: #1e1e1e;
    border: 1px solid #333;
    border-top: none;
    border-radius: 0 0 0.25rem 0.25rem;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

/* Tyre sub-tab content - no border/background to avoid nesting issues */
#tyreSubTabContent {
    background-color: transparent;
    border: none;
    padding: 0;
    margin-bottom: 0;
}

/* Product Card */
.product-card {
    border: 1px solid #333 !important;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: rgba(30, 30, 30, 0.8);
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(220, 53, 69, 0.3);
    border-color: #dc3545;
}

/* Product Image */
.product-img-container {
    background-color: #1a1a1a;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    height: 180px;
}

/* Product Card Body */
.product-card .card-body {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

/* Product Title */
.product-card .card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Size Badges */
.size-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    margin-right: 0.25rem;
    margin-bottom: 0.25rem;
    background-color: #333;
    color: #fff;
    border-radius: 0.25rem;
    display: inline-block;
}

/* Loading State */
.loading-spinner {
    display: inline-block;
    width: 2rem;
    height: 2rem;
    border: 0.25rem solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #dc3545;
    animation: spin 1s ease-in-out infinite;
    margin: 2rem auto;
}

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

/* Product Price */
.product-card .text-danger {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #f0ad4e !important;
}

/* Product Description */
.product-card .card-text {
    color: #bbb;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    flex-grow: 1;
    line-height: 1.6;
}

/* Enquire Button */
.btn-outline-danger {
    border-color: #dc3545;
    color: #dc3545;
    transition: all 0.3s ease;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.5rem 1rem;
}

.btn-outline-danger:hover {
    background-color: #dc3545;
    color: #fff;
}

/* Swiper Navigation */
.swiper-button-next,
.swiper-button-prev {
    color: #dc3545 !important;
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.swiper-button-next:after,
.swiper-button-prev:after {
    font-size: 1.5rem !important;
}

.swiper-button-next:hover,
.swiper-button-prev:hover {
    background: rgba(220, 53, 69, 0.9);
    color: #fff !important;
}

/* Swiper Pagination */
.swiper-pagination-bullet {
    background: #6c757d;
    opacity: 1;
    width: 10px;
    height: 10px;
    margin: 0 5px !important;
}

.swiper-pagination-bullet-active {
    background: #dc3545;
    transform: scale(1.2);
}

/* Responsive Adjustments */
@media (max-width: 1199.98px) {
    .featured-products-swiper {
        padding: 1.5rem 0.5rem 3rem !important;
    }
}

@media (max-width: 991.98px) {
    #featured-products .section-title {
        font-size: 2rem;
    }
    
    .product-card .card-title {
        font-size: 1.1rem;
    }
    
    .product-card .text-danger {
        font-size: 1.1rem;
    }
}

@media (max-width: 767.98px) {
    #featured-products {
        padding: 3rem 0;
    }
    
    .featured-products-swiper {
        padding: 1rem 0.25rem 2.5rem !important;
    }
    
    .swiper-button-next,
    .swiper-button-prev {
        display: none !important;
    }
}

/* Ensure proper spacing between slides */
.swiper-wrapper {
    padding: 10px 0;
}

/* Fix for Swiper container overflow */
.swiper-container {
    overflow: visible;
}

/* Ensure proper card height in Swiper */
.swiper-slide > div {
    height: 100%;
}

/* View All Button */
#featured-products .btn-outline-danger {
    padding: 0.5rem 1.5rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-width: 2px;
}

#featured-products .btn-outline-danger i {
    transition: transform 0.3s ease;
}

#featured-products .btn-outline-danger:hover i {
    transform: translateX(3px);
}

/* No products message */
.alert-info {
    background-color: rgba(13, 110, 253, 0.1) !important;
    border-color: rgba(13, 110, 253, 0.25) !important;
    color: #0dcaf0 !important;
    padding: 1rem 1.5rem;
    border-radius: 8px;
}

.alert-info i {
    margin-right: 0.5rem;
}

.products-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('../images/background-pattern.png') center/cover no-repeat;
    opacity: 0.03;
    z-index: 0;
}

.product-card {
    border: none;
    border-radius: 15px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 30px;
    background: rgba(30, 30, 30, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 1;
}

.product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #d9230f, #f0ad4e);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.product-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.5);
    border-color: rgba(217, 35, 15, 0.3);
}

.product-card:hover::before {
    opacity: 1;
}

.product-img-container {
    height: 180px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.3s ease;
}

.product-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 15px;
    transition: transform 0.5s ease;
}

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

.product-body {
    padding: 15px;
    position: relative;
    z-index: 2;
    background: transparent;
}

.product-title {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: #fff;
    font-family: 'Montserrat', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.product-description {
    color: #bbb;
    margin-bottom: 20px;
    min-height: 40px;
    font-size: 0.95rem;
    line-height: 1.6;
    font-weight: 300;
}

.product-price {
    font-weight: 700;
    color: #f0ad4e;
    font-size: 1.3rem;
    margin-bottom: 15px;
    display: block;
}

.view-all-btn {
    margin-top: 40px;
    text-align: center;
    position: relative;
    z-index: 2;
}

.section-title {
    color: #fff;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 15px;
    position: relative;
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, #d9230f, #f0ad4e);
    border-radius: 3px;
}

.text-muted {
    color: #bbb !important;
    font-size: 1.1rem;
    margin-bottom: 30px;
    display: block;
}

/* Admin Styles */
.admin-actions {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 10;
    display: flex;
    gap: 5px;
}

.admin-actions .btn {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 0.8rem;
    transition: all 0.3s ease;
    border: none;
}

.admin-actions .btn-edit {
    background: rgba(52, 152, 219, 0.9);
    color: white;
}

.admin-actions .btn-delete {
    background: rgba(231, 76, 60, 0.9);
    color: white;
}

.admin-actions .btn:hover {
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.3);
}

/* Image Upload Preview */
.image-upload-container {
    margin-top: 15px;
    background: rgba(0, 0, 0, 0.2);
    padding: 15px;
    border-radius: 8px;
    border: 1px dashed rgba(255, 255, 255, 0.1);
}

.upload-preview {
    max-width: 100%;
    max-height: 200px;
    margin-top: 15px;
    border-radius: 8px;
    display: none;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.upload-btn-wrapper {
    position: relative;
    overflow: hidden;
    display: inline-block;
    width: 100%;
}

.upload-btn-wrapper input[type=file] {
    font-size: 100px;
    position: absolute;
    left: 0;
    top: 0;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.upload-btn-wrapper .btn {
    width: 100%;
    border: 2px dashed rgba(255, 255, 255, 0.2);
    color: #bbb;
    background-color: rgba(0, 0, 0, 0.2);
    padding: 15px;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(217, 35, 15, 0.4);
}

.btn-primary:hover::before {
    width: 100%;
}

.btn-outline-primary {
    color: #d9230f;
    border-color: #d9230f;
    font-weight: 600;
    transition: all 0.3s ease;
}

/* Tyre Size Badges */
.tyre-size-badge {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 12px 8px;
    text-align: center;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s ease;
    color: #fff;
    cursor: pointer;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.tyre-size-badge:hover {
    background: rgba(220, 53, 69, 0.15);
    border-color: #dc3545;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.2);
}

.tyre-size-badge.selected {
    background: rgba(220, 53, 69, 0.3);
    border-color: #dc3545;
    border-width: 2px;
    box-shadow: 0 0 15px rgba(220, 53, 69, 0.5);
    transform: scale(1.05);
}

.tyre-size-badge.selected::after {
    content: '\f00c';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    position: absolute;
    top: 2px;
    right: 2px;
    background: #dc3545;
    color: white;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
}

.tyre-size-badge i {
    font-size: 11px;
    margin-right: 4px;
}

/* Special badge styles */
.badge-at {
    background: rgba(255, 193, 7, 0.1);
    border-color: rgba(255, 193, 7, 0.3);
}

.badge-at:hover {
    background: rgba(255, 193, 7, 0.2);
    border-color: #ffc107;
}

.badge-ww {
    background: rgba(240, 173, 78, 0.1);
    border-color: rgba(240, 173, 78, 0.3);
}

.badge-ww:hover {
    background: rgba(240, 173, 78, 0.2);
    border-color: #f0ad4e;
}

.badge-bw {
    background: rgba(108, 117, 125, 0.1);
    border-color: rgba(108, 117, 125, 0.3);
}

.badge-bw:hover {
    background: rgba(108, 117, 125, 0.2);
    border-color: #6c757d;
}

/* Tyre category header */
.tyre-category-header h4 {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tyre-category-header p {
    font-size: 0.95rem;
}

/* Sub-tab pills styling */
.nav-pills .nav-link {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin: 0 5px 10px 5px;
    border-radius: 25px;
    padding: 10px 20px;
    font-weight: 500;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    cursor: pointer;
    pointer-events: auto;
    position: relative;
    z-index: 100;
}

.nav-pills .nav-link:hover {
    background-color: rgba(220, 53, 69, 0.1);
    border-color: rgba(220, 53, 69, 0.3);
    color: #dc3545;
}

.nav-pills .nav-link.active {
    background-color: #dc3545;
    border-color: #dc3545;
    color: #fff;
}

.nav-pills .nav-link i {
    font-size: 0.85rem;
    pointer-events: none;
}

.nav-pills {
    position: relative;
    z-index: 100;
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .products-section {
        padding: 60px 0;
    }
    
    .section-title {
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    .product-card {
        margin-bottom: 25px;
        max-width: 400px;
        margin-left: auto;
        margin-right: auto;
    }
    
    .product-img-container {
        height: 160px;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
    
    .text-muted {
        font-size: 1rem;
    }
    
    .nav-pills .nav-link {
        font-size: 0.8rem;
        padding: 8px 12px;
        margin: 0 3px 8px 3px;
    }
    
    .nav-pills .nav-link i {
        font-size: 0.75rem;
    }
    
    .tyre-size-badge {
        font-size: 12px;
        padding: 10px 6px;
        min-height: 45px;
    }
    
    .tyre-category-header h4 {
        font-size: 1.3rem;
    }
}

@media (max-width: 576px) {
    .products-section {
        padding: 50px 0;
    }
    
    .section-title {
        font-size: 1.6rem;
    }
    
    .product-title {
        font-size: 1.2rem;
    }
    
    .product-price {
        font-size: 1.1rem;
    }
    
    .btn {
        padding: 6px 16px;
        font-size: 0.8rem;
    }
    
    .nav-pills {
        flex-wrap: wrap;
    }
    
    .nav-pills .nav-link {
        font-size: 0.75rem;
        padding: 6px 10px;
        margin: 0 2px 6px 2px;
    }
    
    .tyre-size-badge {
        font-size: 11px;
        padding: 8px 4px;
    }
}
