/* Scrollbar Styles */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}

/* Smooth Scroll */
html {
    scroll-behavior: smooth;
}

/* Line Clamp Utility */
.line-clamp-8 {
    display: -webkit-box;
    -webkit-line-clamp: 8;
    line-clamp: 8;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Modal Overlay */
.modal-overlay {
    visibility: hidden !important;
    display: flex !important;
    transition: visibility 0.3s ease;
    pointer-events: none !important;
}

.modal-overlay.open,
#product-modal.open,
#door-modal.open,
#product-modal.modal-overlay.open,
#door-modal.modal-overlay.open {
    visibility: visible !important;
    pointer-events: auto !important;
}

/* Force visibility for product modal specifically */
#product-modal.modal-overlay.open {
    visibility: visible !important;
    pointer-events: auto !important;
    display: flex !important;
}

/* Force visibility for door modal specifically */
#door-modal.modal-overlay.open {
    visibility: visible !important;
    pointer-events: auto !important;
    display: flex !important;
}

.modal-content {
    transform: scale(0.95);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.modal-overlay.open .modal-content {
    transform: scale(1);
    opacity: 1;
}

/* FAB Button */
.fab-button {
    transition: transform 0.2s ease;
}

.fab-button:hover {
    transform: translateY(-2px);
}

/* No Scrollbar */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}

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

/* Selection */
.selection\:bg-primary\/20::selection {
    background-color: rgba(234, 42, 51, 0.2);
}

/* Navigation Links - Make all bold */
header nav a {
    font-weight: 700 !important;
}

/* Active Navigation Link */
header nav a.active {
    position: relative;
    color: #ea2a33 !important;
    font-weight: 700 !important;
}

header nav a.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    right: 0;
    height: 2px;
    background-color: #ea2a33;
    border-radius: 2px;
}

/* Dark mode support for active link */
.dark header nav a.active {
    color: #ea2a33 !important;
}

/* Mobile Menu Animation */
#mobile-menu {
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
}

#mobile-menu.hidden {
    opacity: 0;
    transform: translateY(-10px);
}

#mobile-menu:not(.hidden) {
    opacity: 1;
    transform: translateY(0);
}

/* Product Modal - Vertical Layout (Images Top, Content Bottom) - All Scrollable Together */
.modal-content {
    display: flex;
    flex-direction: column;
}

/* Scrollable Container - Images and Content Together */
#product-modal .modal-content>div.flex-1 {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    min-height: 0;
}

/* Image Container - Full Width Top, Auto Height */
.product-modal-image-container {
    width: 100% !important;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

#carousel-slider {
    width: 100%;
    display: flex;
    align-items: center;
    overflow-x: auto;
    overflow-y: hidden;
}

#carousel-slider>div {
    width: 100% !important;
    flex-shrink: 0;
    flex-grow: 0;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

#carousel-slider>div img {
    width: 100%;
    height: auto;
    max-height: 70vh;
    object-fit: contain;
    display: block;
}

/* Content Container - Full Width Below */
#product-modal .modal-content>div.flex-1>div:last-child {
    width: 100% !important;
}

/* Mobile Specific Styles */
@media (max-width: 768px) {
    .modal-content {
        max-height: 95vh !important;
        overflow: hidden;
        border-radius: 0.75rem;
    }

    #carousel-slider>div img {
        max-height: 50vh;
    }

}

/* Close button mobile styling */
#product-modal button[onclick="closeModal()"],
#door-modal button[onclick="closeModal()"] {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Hero Slider Styles */
.hero-slider {
    width: 100%;
    height: 100%;
    border-radius: 0.75rem;
    overflow: hidden;
    background: #fcf8f8;
}

.dark .hero-slider {
    background: #1a1a1a;
}

.hero-slider .swiper-slide {
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (min-width: 640px) {
    .hero-slider .swiper-slide {}
}

@media (min-width: 768px) {
    .hero-slider .swiper-slide {}
}

@media (min-width: 1024px) {
    .hero-slider .swiper-slide {}
}

.hero-slider .swiper-slide img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
    object-position: center;
}

/* Swiper Navigation Buttons */
.hero-slider .swiper-button-next,
.hero-slider .swiper-button-prev {
    color: #ea2a33;
    background: rgba(255, 255, 255, 0.9);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.hero-slider .swiper-button-next:hover,
.hero-slider .swiper-button-prev:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.1);
}

.hero-slider .swiper-button-next::after,
.hero-slider .swiper-button-prev::after {
    font-size: 20px;
    font-weight: bold;
}

/* Swiper Pagination */
.hero-slider .swiper-pagination {
    bottom: 20px !important;
}

.hero-slider .swiper-pagination-bullet {
    width: 12px;
    height: 12px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 1;
    transition: all 0.3s ease;
}

.hero-slider .swiper-pagination-bullet-active {
    background: #ea2a33;
    width: 32px;
    border-radius: 6px;
}

/* Dark mode support for slider */
.dark .hero-slider .swiper-button-next,
.dark .hero-slider .swiper-button-prev {
    background: rgba(26, 26, 26, 0.9);
    color: #ea2a33;
}

.dark .hero-slider .swiper-button-next:hover,
.dark .hero-slider .swiper-button-prev:hover {
    background: rgba(26, 26, 26, 1);
}

/* Product Tabs */
.tab-button {
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-button.active {
    color: #ea2a33 !important;
    border-bottom-color: #ea2a33 !important;
}

.tab-button:not(.active) {
    color: #6b7280;
    border-bottom-color: transparent;
}

.dark .tab-button:not(.active) {
    color: #9ca3af;
}

.tab-button:hover:not(.active) {
    color: #ea2a33;
}

/* Door Card Hover Effects */
.door-card {
    position: relative;
    transition: all 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.door-card img {
    transition: transform 1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
    transform-origin: center center;
}

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

.door-card h3 {
    letter-spacing: 1px;
    font-weight: 700;
    transition: all 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

#door-modal button[onclick="closeDoorModal()"] {
    width: 45px;
    height: 45px;
}

.top-title {
    width: 100%;
    font-size: 26px;
    font-weight: bold;
}

/* Door Modal Mobile Scrolling */
@media (max-width: 768px) {
    #door-modal .modal-content {
        max-height: 95vh;
        overflow: hidden;
    }

    #door-modal .flex.flex-col.md\\:flex-row {
        flex-direction: column;
    }

    #door-modal .w-full.md\\:w-1\\/2:first-child {
        position: relative;
        flex-shrink: 0;
        min-height: auto;
    }

    #door-modal .w-full.md\\:w-1\\/2:first-child img {
        max-height: 60vh;
        width: 100%;
        object-fit: contain;
    }

    #door-modal .w-full.md\\:w-1\\/2:last-child {
        flex: 1;
        min-height: 0;
    }

    .padding-10 {
        padding: 10px !important;
    }
}