/* CSS Variables - JB EventBau Corporate Colors */
:root {
    --jb-primary: #B91C2E;
    --jb-primary-dark: #A01D2F;
    --jb-secondary: #3A3A3A;
    --jb-light: #F8F9FA;
    --jb-white: #FFFFFF;
}

/* Shop Body Styles */
body.shop-body {
    background-color: #f5f7fa;
}

/* Background Cover */
.bg-cover {
    background: linear-gradient(135deg, #f5f7fa 0%, #e9ecef 50%, #dee2e6 100%);
    position: relative;
}

.bg-cover::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("../img/bauzaun-dqz7k9K.png");
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    opacity: 0.08;
    z-index: -1;
}

/* General Card Styles - Only for non-product cards */
.card:not(.product-card) .card-body {
    min-height: 200px;
}

@media (max-width: 768px) {
    .card:not(.product-card) .card-body {
        min-height: auto;
    }
}

/* Main Layout */
main {
    transition: padding-top 0.2s ease;
}

/* Brand Color Overrides */
.btn-primary {
    background-color: var(--jb-primary) !important;
    border-color: var(--jb-primary) !important;
}

.btn-primary:hover {
    background-color: var(--jb-primary-dark) !important;
    border-color: var(--jb-primary-dark) !important;
}

.btn-outline-primary {
    color: var(--jb-primary) !important;
    border-color: var(--jb-primary) !important;
}

.btn-outline-primary:hover {
    background-color: var(--jb-primary) !important;
    border-color: var(--jb-primary) !important;
    color: white !important;
}

.bg-primary {
    background-color: var(--jb-primary) !important;
}

.text-primary {
    color: var(--jb-primary) !important;
}

.badge.bg-primary {
    background-color: var(--jb-primary) !important;
}

/* Remove all yellow/warning colors */
.bg-warning, .text-warning, .badge.bg-warning {
    background-color: var(--jb-secondary) !important;
    color: white !important;
}

/* Turbo Progress Bar */
.turbo-progress-bar {
    background-color: var(--jb-primary) !important;
}

/* Product Card Styles */
.product-card {
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.3s ease;
}

.product-card:hover {
    box-shadow: 0 8px 16px rgba(160, 29, 47, 0.15) !important;
}

.product-card .card-img-top {
    height: 200px;
    width: 100%;
    object-fit: contain;
    object-position: center;
    background-color: #f8f9fa;
    border-radius: 0.5rem 0.5rem 0 0;
    flex-shrink: 0;
}

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

.product-card .product-badge {
    font-size: 0.6875rem;
    padding: 0.22rem 0.55rem;
}

.product-card .product-price {
    font-size: 0.875rem;
    font-weight: 600;
}

.product-card .product-title {
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.3;
    height: 2.6em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    margin-bottom: 0.5rem;
}

.product-card .product-description {
    font-size: 0.75rem;
    line-height: 1.4;
    height: 4.2em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    margin-bottom: 0.75rem;
}

.product-card .product-button {
    font-size: 0.8rem;
    padding: 0.5rem 0.75rem;
    transition: all 0.2s ease;
    margin-top: auto;
}

.product-button-icon {
    font-size: 0.7rem;
    margin-left: 0.25rem;
    transition: transform 0.2s ease;
}

.product-card:hover .product-button-icon {
    transform: translateX(3px);
}

/* Category Cards - Horizontal Layout */
.category-card {
    transition: box-shadow 0.3s ease;
    background: white;
}

.category-card:hover {
    box-shadow: 0 0.5rem 1rem rgba(160, 29, 47, 0.15) !important;
}

.category-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(185, 28, 46, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.category-icon i {
    font-size: 1.25rem;
}

.category-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--jb-secondary);
    margin-bottom: 0;
}

.category-count {
    font-size: 0.75rem;
    color: #6c757d;
}

.category-arrow {
    color: var(--jb-primary);
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.category-card:hover .category-arrow {
    opacity: 1;
}

/* Mobile: vertical cards with description */
@media (max-width: 767px) {
    .category-card .card-body {
        padding: 1rem !important;
    }
}

/* Card Border Radius */
.card {
    border-radius: 0.75rem;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 249, 250, 0.95) 100%), url("../img/bauzaun-dqz7k9K.png");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
}

/* Product Detail Images - Carousel and Single Images - Override Bootstrap */
.product-detail-image,
#productImageCarousel img.product-detail-image,
#productCarousel img.product-detail-image,
#productCarousel .carousel-item img {
    width: 100% !important;
    height: 400px !important;
    object-fit: contain !important;
    object-position: center !important;
    background-color: #f8f9fa;
    border-radius: 0.5rem 0.5rem 0 0;
    display: block !important;
    max-width: 100% !important;
    max-height: 400px !important;
}

.product-detail-placeholder {
    width: 100%;
    height: 250px;
    border-radius: 0.5rem 0.5rem 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Carousel container constraints for product detail images - Override Bootstrap */
#productImageCarousel,
#productCarousel {
    width: 100% !important;
    overflow: hidden !important;
    max-height: 250px !important;
    height: 250px !important;
}

#productImageCarousel .carousel-inner,
#productCarousel .carousel-inner {
    width: 100% !important;
    overflow: hidden !important;
    max-height: 250px !important;
    height: 250px !important;
}

#productImageCarousel .carousel-item,
#productCarousel .carousel-item {
    width: 100% !important;
    overflow: hidden !important;
    height: 250px !important;
    max-height: 250px !important;
}

#productImageCarousel .carousel-item.active,
#productCarousel .carousel-item.active {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

@media (max-width: 768px) {
    .product-detail-image,
    #productImageCarousel img.product-detail-image,
    #productCarousel img.product-detail-image,
    #productCarousel .carousel-item img {
        height: 200px !important;
        max-height: 200px !important;
    }

    .product-detail-placeholder {
        height: 200px;
    }

    #productImageCarousel,
    #productCarousel {
        max-height: 200px !important;
        height: 200px !important;
    }

    #productImageCarousel .carousel-inner,
    #productCarousel .carousel-inner {
        max-height: 200px !important;
        height: 200px !important;
    }

    #productImageCarousel .carousel-item,
    #productCarousel .carousel-item {
        height: 200px !important;
        max-height: 200px !important;
    }

    .carousel-inner img:not(.product-detail-image),
    .carousel-item img:not(.product-detail-image) {
        max-height: 300px;
    }
}

@media (min-width: 768px) {
    .product-detail-image,
    #productImageCarousel img.product-detail-image,
    #productCarousel img.product-detail-image,
    #productCarousel .carousel-item img {
        height: 300px !important;
        max-height: 300px !important;
    }

    .product-detail-placeholder {
        height: 300px;
    }

    #productImageCarousel,
    #productCarousel {
        max-height: 300px !important;
        height: 300px !important;
    }

    #productImageCarousel .carousel-inner,
    #productCarousel .carousel-inner {
        max-height: 300px !important;
        height: 300px !important;
    }

    #productImageCarousel .carousel-item,
    #productCarousel .carousel-item {
        height: 300px !important;
        max-height: 300px !important;
    }

    .carousel-inner img:not(.product-detail-image),
    .carousel-item img:not(.product-detail-image) {
        max-height: 400px;
    }
}

@media (min-width: 992px) {
    .product-detail-image,
    #productImageCarousel img.product-detail-image,
    #productCarousel img.product-detail-image,
    #productCarousel .carousel-item img {
        height: 350px !important;
        max-height: 350px !important;
    }

    .product-detail-placeholder {
        height: 350px;
    }

    #productImageCarousel,
    #productCarousel {
        max-height: 350px !important;
        height: 350px !important;
    }

    #productImageCarousel .carousel-inner,
    #productCarousel .carousel-inner {
        max-height: 350px !important;
        height: 350px !important;
    }

    #productImageCarousel .carousel-item,
    #productCarousel .carousel-item {
        height: 350px !important;
        max-height: 350px !important;
    }

    .carousel-inner img:not(.product-detail-image),
    .carousel-item img:not(.product-detail-image) {
        max-height: 450px;
    }
}

@media (max-width: 576px) {
    .product-card .card-img-top {
        height: 160px;
    }

    .product-detail-image,
    #productImageCarousel img.product-detail-image,
    #productCarousel img.product-detail-image,
    #productCarousel .carousel-item img {
        height: 150px !important;
        max-height: 150px !important;
    }

    .product-detail-placeholder {
        height: 150px;
    }

    #productImageCarousel,
    #productCarousel {
        max-height: 150px !important;
        height: 150px !important;
    }

    #productImageCarousel .carousel-inner,
    #productCarousel .carousel-inner {
        max-height: 150px !important;
        height: 150px !important;
    }

    #productImageCarousel .carousel-item,
    #productCarousel .carousel-item {
        height: 150px !important;
        max-height: 150px !important;
    }

    .carousel-inner img:not(.product-detail-image),
    .carousel-item img:not(.product-detail-image) {
        max-height: 200px;
    }

    .product-card .card-body {
        padding: 0.75rem;
    }

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

    .product-card .product-description {
        font-size: 0.7rem;
    }
}

/* Carousel Images - Ensure they fit containers */
/* Note: .product-detail-image takes precedence with !important */
.carousel-inner img:not(.product-detail-image),
.carousel-item img:not(.product-detail-image) {
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: cover;
    object-position: center;
    display: block;
}

/* Ensure all product images fit their containers */
/* Note: .product-card .card-img-top has specific height rules below */
.card-img-top:not(.product-card .card-img-top) {
    width: 100%;
    height: auto;
    object-fit: cover;
    object-position: center;
    display: block;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .product-card .card-img-top {
        height: 180px;
    }

    .display-4 {
        font-size: 2.5rem !important;
    }

    .display-5 {
        font-size: 2rem !important;
    }

    .display-6 {
        font-size: 1.5rem !important;
    }
}

/* Footer Styles */
footer .footer-link {
    color: var(--jb-secondary);
    transition: color 0.2s ease;
}

footer .footer-link:hover {
    color: var(--jb-primary);
}

footer .footer-link i {
    color: var(--jb-primary);
}

/* Required Field Indicator */
label.required::after,
.form-label.required::after {
    content: " *";
    color: var(--jb-primary);
    font-weight: bold;
}

/* Bootstrap form validation styles */
.was-validated .form-control:invalid,
.form-control.is-invalid {
    border-color: #dc3545;
    padding-right: calc(1.5em + 0.75rem);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.was-validated .form-control:valid,
.form-control.is-valid {
    border-color: #198754;
    padding-right: calc(1.5em + 0.75rem);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%23198754' d='M2.3 6.73.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.invalid-feedback,
.valid-feedback {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.875em;
}

.invalid-feedback {
    color: #dc3545;
}

.valid-feedback {
    color: #198754;
}

/* Select2 Bootstrap Design Override */
.select2-container--default .select2-selection--single {
    height: calc(3.5rem + 2px) !important;
    border: 1px solid #dee2e6 !important;
    border-radius: 0.375rem !important;
    padding: 0.375rem 0.75rem !important;
    background-color: #fff !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: calc(3.5rem) !important;
    padding-left: 0 !important;
    color: #212529 !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: calc(3.5rem) !important;
    top: 0 !important;
    right: 0.75rem !important;
}

.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--single {
    border-color: #86b7fe !important;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25) !important;
}

.select2-dropdown {
    border: 1px solid #dee2e6 !important;
    border-radius: 0.375rem !important;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: var(--jb-primary) !important;
    color: white !important;
}

.select2-container--default .select2-results__option[aria-selected=true] {
    background-color: #e9ecef !important;
    color: #212529 !important;
}

.select2-container--default .select2-search--dropdown .select2-search__field {
    border: 1px solid #dee2e6 !important;
    border-radius: 0.375rem !important;
    padding: 0.375rem 0.75rem !important;
}

.select2-container--default .select2-search--dropdown .select2-search__field:focus {
    border-color: #86b7fe !important;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25) !important;
    outline: 0 !important;
}
