/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
    overflow-x: hidden;
    width: 100%;
    margin: 0;
    padding-top: 0;
}

/* Main page (homepage with carousel) needs padding on desktop */
body:has(.hero) {
    padding-top: 120px;
}

@media (max-width: 768px) {
    body {
        padding-top: 50px;
    }
    
    /* Main page (homepage with carousel) needs more padding */
    body:has(.hero) {
        padding-top: 120px;
    }
}

@media (max-width: 480px) {
    body {
        padding-top: 50px;
    }
    
    /* Main page (homepage with carousel) needs more padding */
    body:has(.hero) {
        padding-top: 120px;
    }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

/* Header Styles */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0,0,0,0.1);
    z-index: 1000;
    transition: all 0.3s ease;
}

.header-top {
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 10px 0;
    font-size: 0.9rem;
    color: white;
}

.contact-info {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
}

.contact-info a {
    color: white;
    text-decoration: none;
    transition: opacity 0.3s;
}

.contact-info a:hover {
    opacity: 0.8;
}

.navbar-wrapper {
    background: transparent;
    border-bottom: 1px solid rgba(224, 224, 224, 0.3);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}

.logo img {
    height: 40px;
    width: auto;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 30px;
}

.nav-menu a {
    color: #333;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
    padding: 8px 0;
    border-bottom: 3px solid transparent;
    font-size: 0.95rem;
}

.nav-menu a:hover {
    color: #bb162b;
    border-bottom-color: #bb162b;
}

/* Dropdown Menu */
.nav-menu .dropdown {
    position: relative;
}

.nav-menu .dropdown > a::after {
    content: ' ▼';
    font-size: 0.7em;
    margin-left: 4px;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: white;
    min-width: 220px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    border-radius: 5px;
    padding: 10px 0;
    margin-top: 10px;
    z-index: 1000;
    list-style: none;
}

.dropdown:hover .dropdown-menu {
    display: block;
}

.dropdown-menu li {
    padding: 0;
}

.dropdown-menu a {
    display: block;
    padding: 10px 18px;
    color: #333;
    text-decoration: none;
    border-bottom: none !important;
    transition: background-color 0.3s, color 0.3s;
    font-size: 0.9rem;
    white-space: nowrap;
}

.dropdown-menu a:hover {
    background-color: #f5f5f5;
    color: #bb162b;
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 4px;
    z-index: 1001;
    position: relative;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background-color: #333;
    transition: 0.3s;
}

/* Hero Section / Carousel */
.hero {
    position: relative;
    width: 100%;
    overflow: hidden;
    background-color: #000;
    margin: 0;
    padding: 0;
}

main {
    margin: 0;
    padding: 0;
}

/* Fix for pages without hero - add top padding to first section */
main > section:first-child:not(.hero) {
    padding-top: 150px;
}

@media (max-width: 768px) {
    main > section:first-child:not(.hero) {
        padding-top: 120px;
    }
}

@media (max-width: 480px) {
    main > section:first-child:not(.hero) {
        padding-top: 110px;
    }
}

.carousel {
    position: relative;
    width: 100%;
    height: 60vh;
    min-height: 400px;
    margin: 0;
    padding: 0;
    background-color: #000;
}

.carousel::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    border: 4px solid rgba(187, 22, 43, 0.3);
    border-top-color: #bb162b;
    border-radius: 50%;
    animation: carousel-loading 0.8s linear infinite;
    opacity: 1;
    transition: opacity 0.3s;
    z-index: 5;
}

.carousel[style*="opacity: 1"]::before {
    opacity: 0;
    pointer-events: none;
}

@keyframes carousel-loading {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

@media (max-width: 768px) {
    .carousel {
        height: 40vh;
        min-height: 300px;
    }
}

@media (max-width: 480px) {
    .carousel {
        height: 35vh;
        min-height: 250px;
    }
}

.carousel-progress {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background-color: rgba(0, 0, 0, 0.3);
    z-index: 25;
}

.progress-bar {
    height: 100%;
    width: 0;
    background-color: #bb162b;
    box-shadow: 0 0 10px rgba(187, 22, 43, 0.8);
}

@keyframes progress {
    0% { width: 0%; }
    100% { width: 100%; }
}

.carousel-inner {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #000;
}

.carousel-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.6s ease-in-out;
    pointer-events: none;
}

.carousel-item.active {
    opacity: 1;
    pointer-events: auto;
}

.carousel-item a {
    display: block;
    width: 100%;
    height: 100%;
    line-height: 0;
}

.carousel-item img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center;
}

.carousel-control {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    padding: 16px 20px;
    cursor: pointer;
    font-size: 24px;
    z-index: 10;
    transition: background-color 0.3s;
}

.carousel-control:hover {
    background-color: rgba(187, 22, 43, 0.8);
}

.carousel-control.prev {
    left: 10px;
}

.carousel-control.next {
    right: 10px;
}

.carousel-dots {
    text-align: center;
    position: absolute;
    bottom: 20px;
    width: 100%;
    z-index: 10;
}

.dot {
    height: 12px;
    width: 12px;
    margin: 0 5px;
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    display: inline-block;
    cursor: pointer;
    transition: background-color 0.3s;
}

.dot.active,
.dot:hover {
    background-color: #bb162b;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 30px;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-primary {
    background-color: white;
    color: #bb162b;
}

.btn-primary:hover {
    background-color: #f0f0f0;
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: #bb162b;
    color: white;
    border: 2px solid #bb162b;
}

.btn-secondary:hover {
    background-color: #960f21;
    border-color: #960f21;
}

/* Vehicle Grid */
.featured-vehicles,
.stock-vehicles,
.vehicles-list,
.services-list {
    padding: 60px 0;
    background-color: white;
    margin-top: 0;
}

.featured-vehicles:nth-child(even),
.stock-vehicles:nth-child(even) {
    background-color: #f9f9f9;
}

.featured-vehicles h2,
.stock-vehicles h2,
.vehicles-list h2,
.services-list h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 40px;
    color: #05141f;
}

.vehicle-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.vehicle-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.vehicle-card {
    background-color: white;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 25px;
    text-align: center;
    transition: background-color 0.3s, border-color 0.3s, transform 0.3s;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.vehicle-image {
    width: 100%;
    height: auto;
    max-height: 200px;
    object-fit: contain;
    margin-bottom: 15px;
    transition: transform 0.3s;
}

.vehicle-card-link:hover .vehicle-card {
    background-color: #f8f8f8;
    border-color: #bb162b;
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(187, 22, 43, 0.2);
}

.vehicle-card:hover {
    background-color: #f8f8f8;
    border-color: #bb162b;
}

.vehicle-card:hover .vehicle-image {
    transform: scale(1.05);
}

.vehicle-card h3 {
    font-size: 1.4rem;
    margin-bottom: 15px;
    color: #05141f;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.vehicle-card .price {
    font-size: 1.8rem;
    font-weight: bold;
    color: #bb162b;
    margin: 10px 0;
}

.vehicle-card .monthly {
    font-size: 1rem;
    color: #666;
}

.badge {
    display: inline-block;
    background-color: #28a745;
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    margin-top: 10px;
}

/* Stock Vehicles Specific */
.stock-intro {
    text-align: center;
    margin-bottom: 40px;
    padding: 20px;
    background-color: #f8f8f8;
    border-radius: 10px;
}

.stock-intro p {
    font-size: 1.1rem;
    color: #666;
}

.stock-card {
    display: flex;
    flex-direction: row;
    height: auto;
    margin-bottom: 20px;
}

.stock-grid {
    grid-template-columns: 1fr !important;
}

.stock-card .vehicle-image-wrapper {
    position: relative;
    width: 300px;
    min-width: 300px;
    height: 200px;
    overflow: hidden;
    border-radius: 10px 0 0 10px;
    background-color: #f5f5f5;
}

@media (max-width: 768px) {
    .stock-card {
        flex-direction: column;
    }
    
    .stock-card .vehicle-image-wrapper {
        width: 100%;
        min-width: unset;
        height: 250px;
        border-radius: 10px 10px 0 0;
    }
    
    .stock-card .vehicle-info {
        padding: 20px 15px;
    }
    
    .vehicle-footer {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .btn-contact {
        width: 100%;
        text-align: center;
    }
}

.vehicle-image-wrapper .vehicle-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.stock-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: #28a745;
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.stock-card .vehicle-info {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
}

.vehicle-specs {
    list-style: none;
    margin: 15px 0;
    flex-grow: 1;
}

.vehicle-specs li {
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.9rem;
    color: #666;
}

.vehicle-specs li:before {
    content: '✓ ';
    color: #bb162b;
    font-weight: bold;
    margin-right: 8px;
}

.vehicle-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 15px;
    border-top: 2px solid #f0f0f0;
}

.btn-contact {
    background-color: #bb162b;
    color: white;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 600;
    transition: background-color 0.3s;
}

.btn-contact:hover {
    background-color: #960f21;
}

/* Used Vehicles / Autobazar */
.btn-autobazar {
    display: inline-block;
    background: linear-gradient(135deg, #bb162b 0%, #960f21 100%);
    color: white;
    padding: 30px 60px;
    text-decoration: none;
    border-radius: 15px;
    font-weight: 600;
    transition: all 0.3s;
    box-shadow: 0 5px 20px rgba(187, 22, 43, 0.3);
    text-align: center;
}

.btn-autobazar:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(187, 22, 43, 0.5);
}

.content-box ul li a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s;
}

.content-box ul li a:hover {
    color: #bb162b;
}

.text-center {
    text-align: center;
}

.financing-note {
    margin-top: 30px;
    padding: 20px;
    background-color: #fff3cd;
    border-left: 4px solid #ffc107;
    font-style: italic;
}

/* Services Grid */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
}

@media (max-width: 768px) {
    .services-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

.service-card {
    background-color: #f9f9f9;
    border-left: 4px solid #bb162b;
    padding: 25px;
    border-radius: 5px;
}

.service-card h3 {
    color: #05141f;
    margin-bottom: 10px;
}

.service-info {
    background-color: #f9f9f9;
    padding: 40px;
    border-radius: 10px;
    text-align: center;
}

.service-info h2 {
    margin-bottom: 20px;
}

.contact-details {
    margin-top: 20px;
}

.contact-details p {
    margin: 10px 0;
    font-size: 1.1rem;
}

/* Contact Section */
.contact-section {
    padding: 60px 0;
    background-color: #f9f9f9;
}

.contact-section h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 40px;
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

@media (max-width: 768px) {
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

.contact-item {
    background-color: white;
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.contact-item h3 {
    color: #bb162b;
    margin-bottom: 15px;
}

/* Page Header */
.page-header {
    background: linear-gradient(135deg, #05141f 0%, #bb162b 100%);
    color: white;
    padding: 0;
    text-align: center;
    margin-top: 0;
}

/* Override the first-section padding for page-headers since they have their own */
main > .page-header:first-child,
main > .page-header-stock:first-child,
main > .page-header-detail:first-child {
    padding-top: 150px;
    padding-bottom: 0;
}

@media (max-width: 768px) {
    main > .page-header:first-child,
    main > .page-header-stock:first-child,
    main > .page-header-detail:first-child {
        padding-top: 50px;
        padding-bottom: 50px;
    }
}

@media (max-width: 480px) {
    main > .page-header:first-child,
    main > .page-header-stock:first-child,
    main > .page-header-detail:first-child {
        padding-top: 50px;
        padding-bottom: 50px;
    }
}

.page-header h1 {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.page-header p {
    font-size: 1.2rem;
    padding-bottom: 25px;
}

/* Content Box */
.content-box {
    background-color: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.content-box ul {
    list-style: none;
    margin-top: 20px;
}

.content-box li {
    padding: 10px 0;
    font-size: 1.1rem;
}

/* Contact Page */
.contact-page {
    padding: 60px 0;
}

.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.contact-details-box {
    background-color: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.contact-details-box h2 {
    color: #05141f;
    margin-bottom: 30px;
}

.detail-item {
    margin-bottom: 25px;
}

.detail-item h3 {
    color: #bb162b;
    margin-bottom: 10px;
}

.map-container {
    position: relative;
    height: 100%;
    min-height: 400px;
}

.map-link {
    display: block;
    position: relative;
    height: 100%;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.map-link iframe {
    border-radius: 10px;
    pointer-events: none;
}

.map-overlay {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(187, 22, 43, 0.95);
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.map-link:hover .map-overlay {
    opacity: 1;
}

/* Footer */
footer {
    background-color: #05141f;
    color: white;
    padding: 40px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 30px;
}

.footer-section h3 {
    color: #bb162b;
    margin-bottom: 15px;
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    padding: 5px 0;
}

.footer-section a {
    color: white;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-section a:hover {
    color: #bb162b;
}

.footer-section p a {
    display: inline-block;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #333;
    color: #999;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        left: -100%;
        top: 0;
        flex-direction: column;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        width: 100%;
        height: 100vh;
        text-align: center;
        transition: left 0.3s ease;
        box-shadow: 0 0 30px rgba(0,0,0,0.2);
        padding: 120px 20px 40px;
        z-index: 999;
        overflow-y: auto;
    }
    
    .nav-menu li {
        padding: 5px 0;
    }
    
    .nav-menu a {
        padding: 15px 20px;
        display: block;
        font-size: 1.05rem;
        border-bottom: none;
    }

    .nav-menu.active {
        left: 0;
    }

    .hamburger.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }

    /* Mobile Dropdown */
    .nav-menu .dropdown {
        position: relative;
    }

    .dropdown-menu {
        position: static;
        display: none;
        box-shadow: none;
        background-color: rgba(245, 245, 245, 0.8);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        margin-top: 0;
        padding: 0;
    }

    .dropdown.active .dropdown-menu {
        display: block;
    }

    .dropdown-menu a {
        padding: 12px 20px;
        font-size: 0.9rem;
        white-space: normal;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .vehicle-grid {
        grid-template-columns: 1fr;
    }

    .contact-content {
        grid-template-columns: 1fr;
    }

    .contact-info {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
        gap: 8px;
        font-size: 0.75rem;
    }
    
    .page-header {
        padding: 40px 0;
    }
    
    .page-header h1 {
        font-size: 2rem;
    }
    
    .featured-vehicles h2,
    .stock-vehicles h2,
    .vehicles-list h2,
    .services-list h2 {
        font-size: 2rem;
    }
    
    .carousel-control {
        padding: 12px 16px;
        font-size: 20px;
    }
    
    .carousel-control.prev {
        left: 5px;
    }
    
    .carousel-control.next {
        right: 5px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    .featured-vehicles,
    .stock-vehicles,
    .vehicles-list {
        padding: 30px 0;
    }

    .page-header {
        padding: 30px 0;
    }

    .page-header h1 {
        font-size: 1.6rem;
    }

    .page-header p {
        font-size: 0.95rem;
    }
    
    .featured-vehicles h2,
    .stock-vehicles h2,
    .vehicles-list h2,
    .services-list h2 {
        font-size: 1.6rem;
        margin-bottom: 25px;
    }

    .vehicle-card {
        padding: 20px 15px;
    }

    .vehicle-card h3 {
        font-size: 1.05rem;
        word-break: break-word;
    }

    .vehicle-card .price {
        font-size: 1.4rem;
    }

    .vehicle-card .monthly {
        font-size: 0.85rem;
    }

    .logo img {
        height: 30px;
    }

    .contact-info {
        font-size: 0.7rem;
    }
    
    .header-top {
        padding: 8px 0;
    }

    .nav-menu {
        top: 105px;
    }

    .service-card,
    .content-box,
    .contact-details-box,
    .service-info {
        padding: 20px 15px;
    }

    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    
    .btn-autobazar {
        padding: 20px 40px;
        font-size: 0.95rem;
    }
    
    .carousel-control {
        padding: 10px 12px;
        font-size: 18px;
    }
    
    .carousel-dots {
        bottom: 10px;
    }
    
    .dot {
        height: 10px;
        width: 10px;
        margin: 0 4px;
    }
    
    .stock-card .vehicle-image-wrapper {
        height: 200px;
    }
    
    .vehicle-specs li {
        font-size: 0.85rem;
        padding: 6px 0;
    }
}

/* Stock Vehicles on Homepage */
.section-subtitle {
    text-align: center;
    color: #666;
    font-size: 1.1rem;
    margin-top: -20px;
    margin-bottom: 30px;
}

.vehicle-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
}

.stock-badge-home {
    display: inline-block;
    background: #28a745;
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: 10px;
}
