/* ========================================
   LUBEK - Comprehensive Responsive Styles
   Mobile-First Approach for All Devices
   ======================================== */

/* ==========================================
   1. BASE RESPONSIVE SETTINGS
   ========================================== */

/* Ensure smooth responsive behavior */
html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

body {
    overflow-x: hidden;
    position: relative;
}

/* Container responsive widths */
.container {
    width: 100%;
    padding-right: 15px;
    padding-left: 15px;
    margin-right: auto;
    margin-left: auto;
}

/* ==========================================
   2. HERO CAROUSEL - FULLY RESPONSIVE
   ========================================== */

/* Hero Carousel Container */
.hero-carousel-section {
    position: relative;
    width: 100%;
    max-width: 100%;
    height: 600px;
    overflow: hidden;
    margin: 70px auto 0 auto;
    padding: 0;
}

.hero-carousel-section #heroCarousel,
.hero-carousel-section .carousel-inner,
.hero-carousel-section .carousel-item {
    width: 100%;
    height: 600px;
    position: relative;
}

.hero-image,
.hero-video {
    width: 100%;
    height: 600px;
    position: absolute !important;
    top: 0;
    left: 0;
    object-fit: cover;
    background-size: cover;
    background-position: center;
    z-index: 1;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ==========================================
   3. SECTION SPACING - RESPONSIVE
   ========================================== */

/* Default section padding */
section {
    padding: 60px 0;
}

.py-5 {
    padding-top: 3rem !important;
    padding-bottom: 3rem !important;
}

/* Card spacing */
.row.g-4 {
    --bs-gutter-x: 1.5rem;
    --bs-gutter-y: 1.5rem;
}

/* ==========================================
   4. IMAGES - FULLY RESPONSIVE
   ========================================== */

/* Category and Product Images */
.category-image,
.product-image {
    width: 100%;
    height: 250px;
    overflow: hidden;
    position: relative;
    border-radius: 12px;
}

.category-image img,
.product-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    transition: transform 0.3s ease;
}

/* Facility and About images */
.facility-image img,
.about-image img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
}

/* Page header carousel */
.page-header-carousel {
    width: 100%;
    height: 400px;
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat;
}

/* ==========================================
   5. NAVIGATION - RESPONSIVE
   ========================================== */

.navbar {
    padding: 0.75rem 0;
}

.navbar-brand img {
    max-height: 40px;
    width: auto;
}

.nav-link {
    padding: 0.5rem 1rem;
    font-size: 1rem;
}

/* ==========================================
   6. TYPOGRAPHY - RESPONSIVE
   ========================================== */

h1, .h1 { font-size: 2.5rem; line-height: 1.2; }
h2, .h2 { font-size: 2rem; line-height: 1.3; }
h3, .h3 { font-size: 1.75rem; line-height: 1.4; }
h4, .h4 { font-size: 1.5rem; line-height: 1.4; }
h5, .h5 { font-size: 1.25rem; line-height: 1.5; }
h6, .h6 { font-size: 1rem; line-height: 1.5; }

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
}

/* ==========================================
   7. TABLET DEVICES (768px - 991px)
   ========================================== */

@media (max-width: 991.98px) {
    /* Hero Carousel */
    .hero-carousel-section {
        margin-top: 65px;
        height: 500px;
    }
    
    .hero-carousel-section #heroCarousel,
    .hero-carousel-section .carousel-inner,
    .hero-carousel-section .carousel-item,
    .hero-image,
    .hero-video {
        height: 500px;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    /* Section spacing */
    section {
        padding: 50px 0;
    }
    
    .py-5 {
        padding-top: 2.5rem !important;
        padding-bottom: 2.5rem !important;
    }
    
    /* Typography */
    h1, .h1 { font-size: 2.25rem; }
    h2, .h2 { font-size: 1.85rem; }
    h3, .h3 { font-size: 1.5rem; }
    
    /* Images */
    .category-image,
    .product-image {
        height: 220px;
    }
    
    .category-image img,
    .product-image img {
        position: absolute !important;
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
    }
    
    .page-header-carousel {
        height: 350px;
    }
    
    /* Navigation */
    .navbar-collapse {
        background: rgba(0, 0, 0, 0.95);
        padding: 1rem;
        margin-top: 0.5rem;
        border-radius: 8px;
    }
    
    .nav-link {
        padding: 0.75rem 1rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .dropdown-menu {
        background: rgba(0, 0, 0, 0.9);
        border: none;
        padding: 0.5rem 0;
    }
    
    .dropdown-item {
        color: #fff !important;
        padding: 0.5rem 1.5rem;
    }
    
    .dropdown-item:hover {
        background: rgba(255, 255, 255, 0.1);
    }
}

/* ==========================================
   8. MOBILE DEVICES (576px - 767px)
   ========================================== */

@media (max-width: 767.98px) {
    /* Hero Carousel */
    .hero-carousel-section {
        margin-top: 60px;
        height: 400px;
    }
    
    .hero-carousel-section #heroCarousel,
    .hero-carousel-section .carousel-inner,
    .hero-carousel-section .carousel-item,
    .hero-image,
    .hero-video {
        height: 400px;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .hero-overlay .btn-lg {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }
    
    /* Section spacing */
    section {
        padding: 40px 0;
    }
    
    .py-5 {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }
    
    /* Container padding */
    .container {
        padding-right: 12px;
        padding-left: 12px;
    }
    
    /* Typography */
    h1, .h1 { font-size: 2rem; }
    h2, .h2 { font-size: 1.65rem; }
    h3, .h3 { font-size: 1.35rem; }
    h4, .h4 { font-size: 1.15rem; }
    
    /* Images */
    .category-image,
    .product-image {
        height: 200px;
    }
    
    .category-image img,
    .product-image img {
        position: absolute !important;
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
    }
    
    .page-header-carousel {
        height: 300px;
    }
    
    /* Cards - Optimized for 2-column layout */
    .category-card,
    .product-card {
        margin-bottom: 1.5rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .category-content,
    .product-content {
        padding: 0.85rem;
    }
    
    .category-title,
    .product-title {
        font-size: 1.1rem;
        line-height: 1.3;
    }
    
    .category-description,
    .product-description {
        font-size: 0.9rem;
        line-height: 1.4;
    }
    
    /* Center last item if odd number of items (2-column layout) */
    .row.g-4,
    .row.g-3 {
        justify-content: flex-start;
    }
    
    /* If last child is alone in a row, center it */
    .row.g-4 > [class*="col-6"]:last-child:nth-child(odd),
    .row.g-3 > [class*="col-6"]:last-child:nth-child(odd) {
        margin-left: auto;
        margin-right: auto;
    }
    
    /* Gap between columns */
    .row.g-4 {
        --bs-gutter-x: 1rem;
        --bs-gutter-y: 1rem;
    }
    
    .row.g-3 {
        --bs-gutter-x: 0.85rem;
        --bs-gutter-y: 0.85rem;
    }
    
    /* Navigation */
    .navbar-brand {
        font-size: 1.15rem;
    }
    
    .navbar-brand img {
        max-height: 35px;
    }
    
    /* Footer */
    .footer .col-lg-4 {
        margin-bottom: 2rem;
    }
}

/* ==========================================
   9. SMALL MOBILE DEVICES (< 576px)
   ========================================== */

@media (max-width: 575.98px) {
    /* Hero Carousel */
    .hero-carousel-section {
        margin-top: 55px;
        height: 350px;
    }
    
    .hero-carousel-section #heroCarousel,
    .hero-carousel-section .carousel-inner,
    .hero-carousel-section .carousel-item,
    .hero-image,
    .hero-video {
        height: 350px;
    }
    
    .hero-title {
        font-size: 1.75rem;
        margin-bottom: 0.75rem;
    }
    
    .hero-subtitle {
        font-size: 0.95rem;
        margin-bottom: 1rem;
    }
    
    .hero-overlay .btn-lg {
        padding: 0.65rem 1.25rem;
        font-size: 0.95rem;
    }
    
    /* Section spacing */
    section {
        padding: 30px 0;
    }
    
    .py-5 {
        padding-top: 1.5rem !important;
        padding-bottom: 1.5rem !important;
    }
    
    /* Container padding */
    .container {
        padding-right: 10px;
        padding-left: 10px;
    }
    
    /* Typography */
    h1, .h1 { font-size: 1.75rem; }
    h2, .h2 { font-size: 1.5rem; }
    h3, .h3 { font-size: 1.25rem; }
    h4, .h4 { font-size: 1.1rem; }
    
    /* Images */
    .category-image,
    .product-image {
        height: 180px;
    }
    
    .category-image img,
    .product-image img {
        position: absolute !important;
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
    }
    
    .page-header-carousel {
        height: 250px;
    }
    
    /* Cards - Optimized for 2-column layout on mobile */
    .category-card,
    .product-card {
        margin-bottom: 1rem;
    }
    
    .card-body {
        padding: 0.85rem;
    }
    
    /* Adjust content padding for 2-column layout */
    .category-content,
    .product-content {
        padding: 0.75rem;
    }
    
    .category-title,
    .product-title {
        font-size: 1rem;
        line-height: 1.3;
        margin-bottom: 0.5rem;
    }
    
    .category-description,
    .product-description {
        font-size: 0.85rem;
        line-height: 1.4;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    
    /* Optimize feature, stat, value, and contact cards for 2-column layout */
    .feature-card,
    .stat-card,
    .value-card,
    .contact-card {
        padding: 1.2rem !important;
        margin-bottom: 1rem;
    }
    
    /* Adjust max-height for mobile devices */
    .feature-card {
        max-height: 320px !important;
    }
    
    .value-card {
        max-height: 320px !important;
    }
    
    .stat-card {
        max-height: 200px !important;
    }
    
    .contact-card {
        max-height: 250px !important;
    }
    
    .category-content,
    .product-content {
        max-height: 200px !important;
    }
    
    .feature-card h3,
    .value-card h3,
    .contact-card h5 {
        font-size: 1rem;
        line-height: 1.3;
    }
    
    .feature-card p,
    .value-card p,
    .contact-card p {
        font-size: 0.85rem;
        line-height: 1.4;
    }
    
    .feature-icon,
    .value-icon,
    .contact-icon {
        width: 55px !important;
        height: 55px !important;
        margin-bottom: 0.85rem !important;
    }
    
    .stat-number {
        font-size: 2.25rem;
    }
    
    .stat-label {
        font-size: 0.9rem;
    }
    
    /* Center last item if odd number of items (2-column layout) */
    .row.g-4,
    .row.g-3 {
        justify-content: flex-start;
    }
    
    /* If last child is alone, center it */
    .row.g-4 > [class*="col-6"]:last-child:nth-child(odd),
    .row.g-3 > [class*="col-6"]:last-child:nth-child(odd) {
        margin-left: auto;
        margin-right: auto;
    }
    
    /* Center last item if odd number of items (2-column layout) */
    .row.g-4,
    .row.g-3 {
        justify-content: flex-start;
    }
    
    /* If last child is alone in a row, center it */
    .row.g-4 > [class*="col-6"]:last-child:nth-child(odd),
    .row.g-3 > [class*="col-6"]:last-child:nth-child(odd) {
        margin-left: auto;
        margin-right: auto;
    }
    
    /* Reduce gap between columns on mobile */
    .row.g-4 {
        --bs-gutter-x: 0.75rem;
        --bs-gutter-y: 0.75rem;
    }
    
    .row.g-3 {
        --bs-gutter-x: 0.65rem;
        --bs-gutter-y: 0.65rem;
    }
    
    /* Navigation */
    .navbar {
        padding: 0.5rem 0;
    }
    
    .navbar-brand {
        font-size: 1rem;
    }
    
    .navbar-brand img {
        max-height: 30px;
    }
    
    .navbar-toggler {
        padding: 0.4rem 0.6rem;
        font-size: 1rem;
    }
    
    /* Buttons */
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    
    .btn-lg {
        padding: 0.6rem 1.2rem;
        font-size: 1rem;
    }
    
    /* Footer */
    .footer {
        font-size: 0.9rem;
        padding: 2.5rem 0 !important;
    }
    
    .footer h5 {
        font-size: 1.1rem;
    }
    
    .footer .col-lg-4 {
        margin-bottom: 1.5rem;
    }
    
    /* Row spacing */
    .row.g-4 {
        --bs-gutter-x: 1rem;
        --bs-gutter-y: 1rem;
    }
}

/* ==========================================
   10. EXTRA SMALL DEVICES (< 400px)
   ========================================== */

@media (max-width: 399.98px) {
    /* Hero Carousel */
    .hero-carousel-section {
        margin-top: 50px;
        height: 300px;
    }
    
    .hero-carousel-section #heroCarousel,
    .hero-carousel-section .carousel-inner,
    .hero-carousel-section .carousel-item,
    .hero-image,
    .hero-video {
        height: 300px;
    }
    
    .hero-title {
        font-size: 1.5rem;
    }
    
    .hero-subtitle {
        font-size: 0.85rem;
    }
    
    .hero-overlay .btn-lg {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
    
    /* Typography */
    h1, .h1 { font-size: 1.5rem; }
    h2, .h2 { font-size: 1.35rem; }
    h3, .h3 { font-size: 1.15rem; }
    
    /* Images */
    .category-image,
    .product-image {
        height: 160px;
    }
    
    .category-image img,
    .product-image img {
        position: absolute !important;
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
    }
    
    .page-header-carousel {
        height: 220px;
    }
    
    /* Navigation */
    .navbar-brand img {
        max-height: 28px;
    }
}

/* ==========================================
   11. LARGE DESKTOP DEVICES (> 1200px)
   ========================================== */

@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }
    
    /* Hero Carousel */
    .hero-carousel-section {
        max-width: 2500px;
    }
    
    .hero-title {
        font-size: 3.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.35rem;
    }
    
    /* Typography */
    h1, .h1 { font-size: 3rem; }
    h2, .h2 { font-size: 2.35rem; }
    h3, .h3 { font-size: 1.85rem; }
    
    /* Images */
    .category-image,
    .product-image {
        height: 280px;
    }
    
    .category-image img,
    .product-image img {
        position: absolute !important;
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
    }
}

/* ==========================================
   12. EXTRA LARGE DEVICES (> 1400px)
   ========================================== */

@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }
    
    /* Images */
    .category-image,
    .product-image {
        height: 300px;
    }
    
    .category-image img,
    .product-image img {
        position: absolute !important;
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
    }
}

/* ==========================================
   13. CAROUSEL INDICATORS - RESPONSIVE
   ========================================== */

.carousel-indicators {
    margin-bottom: 1rem;
}

.carousel-indicators [data-bs-target] {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin: 0 4px;
}

@media (max-width: 767.98px) {
    .carousel-indicators {
        margin-bottom: 0.5rem;
    }
    
    .carousel-indicators [data-bs-target] {
        width: 8px;
        height: 8px;
        margin: 0 3px;
    }
}

/* ==========================================
   13. EXTRA SMALL MOBILE (Below 480px)
      Optimized for 2-column layout on very small screens
   ========================================== */

@media (max-width: 479.98px) {
    /* Further optimize cards for 2-column layout */
    .category-content,
    .product-content {
        padding: 0.5rem;
    }
    
    .category-title,
    .product-title {
        font-size: 0.9rem;
        line-height: 1.2;
        margin-bottom: 0.25rem;
    }
    
    .category-description,
    .product-description {
        font-size: 0.8rem;
        line-height: 1.3;
        -webkit-line-clamp: 2;
    }
    
    /* Reduce image height for 2-column layout */
    .category-image,
    .product-image {
        height: 140px;
    }
    
    .category-image img,
    .product-image img {
        position: absolute !important;
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
    }
    
    /* Optimize feature, stat, value, and contact cards for 2-column layout */
    .feature-card,
    .stat-card,
    .value-card,
    .contact-card {
        padding: 1rem !important;
    }
    
    /* Adjust max-height for extra small mobile devices */
    .feature-card {
        max-height: 280px !important;
    }
    
    .value-card {
        max-height: 280px !important;
    }
    
    .stat-card {
        max-height: 180px !important;
    }
    
    .contact-card {
        max-height: 220px !important;
    }
    
    .category-content,
    .product-content {
        max-height: 170px !important;
    }
    
    .feature-card h3,
    .value-card h3,
    .contact-card h5 {
        font-size: 0.95rem !important;
        line-height: 1.2;
    }
    
    .feature-card p,
    .value-card p,
    .contact-card p,
    .contact-link {
        font-size: 0.8rem !important;
        line-height: 1.3;
    }
    
    .feature-icon,
    .value-icon,
    .contact-icon {
        width: 50px !important;
        height: 50px !important;
        margin-bottom: 0.75rem !important;
    }
    
    .feature-icon i,
    .value-icon i,
    .contact-icon i {
        font-size: 1.2rem !important;
    }
    
    .stat-number {
        font-size: 2rem !important;
    }
    
    .stat-label {
        font-size: 0.85rem !important;
    }
    
    /* Center last item if odd number of items (2-column layout) */
    .row.g-4,
    .row.g-3 {
        justify-content: flex-start;
    }
    
    /* If last child is alone, center it */
    .row.g-4 > [class*="col-6"]:last-child:nth-child(odd),
    .row.g-3 > [class*="col-6"]:last-child:nth-child(odd) {
        margin-left: auto;
        margin-right: auto;
    }
    
    /* Tighter gaps */
    .row.g-4 {
        --bs-gutter-x: 0.5rem;
        --bs-gutter-y: 0.5rem;
    }
    
    .row.g-3 {
        --bs-gutter-x: 0.5rem;
        --bs-gutter-y: 0.5rem;
    }
    
    /* Buttons */
    .btn {
        font-size: 0.85rem;
        padding: 0.4rem 0.8rem;
    }
    
    .btn-sm {
        font-size: 0.75rem;
        padding: 0.3rem 0.6rem;
    }
    
    /* Product SKU and stock status */
    .product-sku,
    .product-stock {
        font-size: 0.75rem;
    }
    
    /* Overlay buttons */
    .category-overlay .btn,
    .product-overlay .btn {
        font-size: 0.8rem;
        padding: 0.4rem 0.9rem;
    }
}

/* ==========================================
   14. UTILITY CLASSES - RESPONSIVE
   ========================================== */

/* Responsive text alignment */
@media (max-width: 767.98px) {
    .text-md-center { text-align: center !important; }
    .text-md-left { text-align: left !important; }
    .text-md-right { text-align: right !important; }
}

/* Responsive margins and padding */
@media (max-width: 575.98px) {
    .mb-sm-3 { margin-bottom: 1rem !important; }
    .mt-sm-3 { margin-top: 1rem !important; }
    .py-sm-3 { padding-top: 1rem !important; padding-bottom: 1rem !important; }
}

/* ==========================================
   15. TOUCH DEVICE OPTIMIZATIONS
   ========================================== */

@media (hover: none) and (pointer: coarse) {
    /* Larger touch targets */
    .btn {
        min-height: 44px;
        padding: 0.65rem 1.25rem;
    }
    
    .nav-link {
        min-height: 44px;
        padding: 0.75rem 1rem;
    }
    
    /* Keep hover effects minimal on touch devices */
    .category-card:hover,
    .product-card:hover {
        transform: translateY(-5px);
    }
    
    /* Overlay appears on hover even on touch devices */
    /* Touch devices can trigger hover by tapping */
    .category-card:hover .category-overlay,
    .product-card:hover .product-overlay {
        opacity: 1;
    }
    
    /* Ensure buttons are visible when overlay is shown */
    .category-card:hover .category-overlay .btn,
    .product-card:hover .product-overlay .btn {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

