/* Custom CSS for Roofing Website - Compact Scale */

/* Global Styles - Reduced Scale */
body {
    font-family: 'Prompt', sans-serif;
    font-size: 0.9rem; /* Reduced from default 1rem */
    line-height: 1.4; /* Reduced from default 1.5 */
}

/* Compact Container */
.container {
    max-width: 1140px; /* Slightly reduced from Bootstrap default */
}

/* Compact Spacing */
.py-5 {
    padding-top: 2.5rem !important; /* Reduced from 3rem */
    padding-bottom: 2.5rem !important;
}

.py-4 {
    padding-top: 2rem !important; /* Reduced from 2.5rem */
    padding-bottom: 2rem !important;
}

.mb-4 {
    margin-bottom: 1.2rem !important; /* Reduced from 1.5rem */
}

.mb-5 {
    margin-bottom: 2rem !important; /* Reduced from 3rem */
}

/* Hero Section - Compact */
.hero {
    background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url('../images/hero-bg.jpg');
    background-size: cover;
    background-position: center;
    color: white;
    padding: 60px 0; /* Reduced from 100px */
}

/* Hero Slideshow - Compact */
.hero-slide {
    min-height: 300px; /* Reduced from 400px */
    display: flex;
    align-items: center;
}

.carousel-item {
    transition: transform 0.6s ease-in-out;
}

.carousel-control-prev,
.carousel-control-next {
    width: 4%; /* Reduced from 5% */
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
    background-size: 80%, 80%; /* Reduced from 100% */
}

.carousel-indicators button {
    width: 10px; /* Reduced from 12px */
    height: 10px; /* Reduced from 12px */
    border-radius: 50%;
}

/* Product Cards - Compact */
.product-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin-bottom: 1rem; /* Reduced spacing */
}

.product-card:hover {
    transform: translateY(-3px); /* Reduced from -5px */
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1); /* Reduced shadow */
}

.product-img {
    height: 160px; /* Reduced from 200px */
    object-fit: cover;
}

/* Products Page Enhancements */
.product-thumb {
    height: 200px; /* ทำให้เท่ากับความสูง SVG ใน index */
    width: 100%;
    object-fit: cover;
    background-color: #f8f9fa; /* พื้นหลังอ่อนเพื่อคงพื้นที่เท่ากัน */
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sticky-sidebar {
    position: sticky;
    top: 1rem;
}

.category-list {
    max-height: 60vh;
    overflow-y: auto;
}

.category-list .list-group-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Card Body Compact */
.card-body {
    padding: 1rem; /* Reduced from default 1.25rem */
}

/* Features Section - Compact */
.feature-icon {
    font-size: 2rem; /* Reduced from 2.5rem */
    color: #0d6efd;
    margin-bottom: 0.75rem; /* Reduced from 1rem */
}

/* Typography - Compact */
h1 {
    font-size: 2rem; /* Reduced */
}

h2 {
    font-size: 1.6rem; /* Reduced */
}

h3 {
    font-size: 1.4rem; /* Reduced */
}

h4 {
    font-size: 1.2rem; /* Reduced */
}

h5 {
    font-size: 1.1rem; /* Reduced */
}

.display-4 {
    font-size: 2.2rem; /* Reduced from default */
}

.lead {
    font-size: 1.1rem; /* Reduced */
    font-weight: 300;
}

/* Admin Dashboard - Compact */
.sidebar {
    min-height: calc(100vh - 48px); /* Reduced navbar height */
}

.dashboard-card {
    transition: transform 0.3s ease;
}

.dashboard-card:hover {
    transform: translateY(-3px); /* Reduced from -5px */
}

/* Navigation - Compact */
.navbar {
    padding: 0.4rem 0; /* Reduced from default */
}

.navbar-brand {
    font-size: 1.1rem; /* Reduced */
}

.nav-link {
    padding: 0.4rem 0.8rem; /* Reduced padding */
    font-size: 0.9rem; /* Reduced font size */
}

/* Header color overrides */
/* Set navbars that use bg-primary to header color without affecting other .bg-primary usage */
.navbar.bg-primary {
    background-color: #9f1c1c !important;
}

/* Top contact bar header color */
.bg-header {
    background-color: #9f1c1c !important;
}

/* Buttons - Compact */
.btn {
    padding: 0.4rem 0.8rem; /* Reduced from default */
    font-size: 0.9rem; /* Reduced font size */
}

.btn-lg {
    padding: 0.6rem 1.2rem; /* Reduced from default */
    font-size: 1rem; /* Reduced font size */
}

/* Tables - Compact */
.table {
    font-size: 0.85rem; /* Reduced font size */
}

.table td, .table th {
    padding: 0.5rem; /* Reduced from default 0.75rem */
}

/* Forms - Compact */
.form-control {
    padding: 0.4rem 0.75rem; /* Reduced padding */
    font-size: 0.9rem; /* Reduced font size */
}

.form-label {
    font-size: 0.9rem; /* Reduced font size */
    margin-bottom: 0.4rem; /* Reduced margin */
}

/* Cart Badge */
.cart-badge {
    position: relative;
    top: -8px; /* Reduced from -10px */
    right: 4px; /* Reduced from 5px */
    font-size: 0.65rem; /* Reduced from 0.7rem */
}

/* Footer - Compact */
footer {
    font-size: 0.85rem; /* Reduced font size */
}

footer a:hover {
    text-decoration: underline;
}

/* Images - Compact */
.product-image {
    width: 60px; /* Reduced from 80px */
    height: 60px; /* Reduced from 80px */
    object-fit: cover;
}

/* Responsive Adjustments - Compact */
@media (max-width: 768px) {
    .hero {
        padding: 40px 0; /* Reduced from 60px */
    }
    
    .hero h1 {
        font-size: 1.6rem; /* Reduced from 2rem */
    }
    
    .container {
        padding-left: 10px; /* Reduced padding */
        padding-right: 10px;
    }
    
    .py-5 {
        padding-top: 2rem !important; /* Further reduced on mobile */
        padding-bottom: 2rem !important;
    }
}

/* Video Gallery Styles */
.video-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: none;
}

.video-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15) !important;
}

.video-thumbnail {
    overflow: hidden;
    border-radius: 0.375rem 0.375rem 0 0;
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.video-thumbnail:hover .video-overlay {
    opacity: 1;
}

.play-btn {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: transform 0.3s ease;
}

.play-btn:hover {
    transform: scale(1.1);
}

/* Carousel Controls for Video Slider */
#videoCarousel .carousel-control-prev,
#videoCarousel .carousel-control-next {
    width: 5%;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 0.375rem;
    margin: 20px 10px;
    height: calc(100% - 40px);
}

#videoCarousel .carousel-control-prev-icon,
#videoCarousel .carousel-control-next-icon {
    background-size: 20px 20px;
}

/* Video Modal */
#videoModal .modal-dialog {
    max-width: 800px;
}

/* Responsive Video Gallery */
@media (max-width: 768px) {
    .video-card {
        margin-bottom: 1rem;
    }
    
    .play-btn {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
    
    #videoCarousel .carousel-control-prev,
    #videoCarousel .carousel-control-next {
        width: 8%;
    }
}