/* 
 * ALFAN 3M CAR CARE - Main Styles
 * Theme: Premium Automotive (Black/White/Red)
 */

:root {
    /* Colors */
    --primary-red: #E60000;
    --primary-red-dark: #cc0000;
    --black: #0a0a0a;
    --black-soft: #1a1a1a;
    --white: #ffffff;
    --gray-light: #f4f4f4;

    /* Internal Header Bg */
    --internal-header-bg: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.8)), url('../assets/img/hero-webp/hero-1.webp');
    --gray-medium: #888888;
    --gray-dark: #333333;

    /* Gradients */
    --gradient-dark: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
    --gradient-red: linear-gradient(135deg, #E60000 0%, #b30000 100%);

    /* Typography */
    --font-main: 'Inter', system-ui, -apple-system, sans-serif;
    --font-heading: 'Oswald', sans-serif;
    /* Powerful automotive feel */

    /* Spacing */
    --container-width: 1200px;
    --header-height: 80px;
    --border-radius: 8px;

    /* Transitions */
    --transition: all 0.3s ease;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    background-color: var(--white);
    color: var(--black);
    line-height: 1.6;
    overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    text-transform: uppercase;
    line-height: 1.2;
    margin-bottom: 1rem;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

/* --- Utilities --- */
.container {
    width: 90%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 15px;
}

.section {
    padding: 80px 0;
}

.bg-dark {
    background-color: var(--black);
    color: var(--white);
}

.bg-light {
    background-color: var(--gray-light);
    color: var(--black);
}

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

.text-red {
    color: var(--primary-red);
}

.flex-center {
    display: flex;
    justify-content: center;
    align-items: center;
}

.grid {
    display: grid;
    gap: 30px;
    /* Default for desktop, responsive override below */
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

/* --- Buttons --- */
.btn {
    display: inline-block;
    padding: 14px 32px;
    font-weight: 600;
    text-transform: uppercase;
    border-radius: 4px;
    /* Slightly squarer for automotive feel */
    cursor: pointer;
    font-size: 0.9rem;
    letter-spacing: 1px;
    border: none;
}

.btn-primary {
    background: var(--primary-red);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-red-dark);
    transform: translateY(-2px);
}

.btn-outline {
    border: 2px solid var(--white);
    color: var(--white);
    background: transparent;
}

.btn-outline:hover {
    background: var(--white);
    color: var(--black);
}

.btn-outline-dark {
    border: 2px solid var(--black);
    color: var(--black);
}

.btn-outline-dark:hover {
    background: var(--black);
    color: var(--white);
}

/* --- Header --- */
.header {
    background-color: var(--black);
    height: var(--header-height);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.header .container {
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    height: 100%;
}

.logo img {
    height: 60px;
    width: auto;
    object-fit: contain;
    transition: var(--transition);
}

@media (max-width: 768px) {
    .logo img {
        height: 45px;
        /* Smaller logo on mobile */
    }

    .header {
        height: 70px;
        /* Slightly smaller header */
    }

    /* Adjust page top margin to match new header height */
    /* Handled by inline styles or refined global rules */
}

.nav-links {
    display: flex;
    gap: 30px;
}

.nav-links a {
    color: var(--white);
    font-weight: 500;
    font-size: 0.95rem;
    position: relative;
    text-transform: uppercase;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-red);
    transition: var(--transition);
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

.hamburger {
    display: none;
    color: var(--white);
    font-size: 1.5rem;
    cursor: pointer;
}

/* --- Mobile Menu --- */
@media (max-width: 768px) {
    .nav-links {
        position: fixed;
        top: var(--header-height);
        right: -100%;
        width: 80%;
        height: calc(100vh - var(--header-height));
        background: var(--black-soft);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        transition: var(--transition);
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.5);
    }

    .nav-links.active {
        right: 0;
    }

    .hamburger {
        display: block;
    }
}

/* --- Hero Section --- */
.hero {
    height: 100vh;
    /* Full viewport height */
    min-height: 600px;
    position: relative;
    display: flex;
    align-items: center;
    color: var(--white);
    overflow: hidden;
    margin-top: 0;
}

.hero-slider {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transform: scale(1);
    z-index: 0;
    will-change: opacity, transform;
}

.slide.active {
    opacity: 1;
}

/* Updated overlay to be above slider but below content */
.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.7));
    z-index: 1;
}

.hero-content {
    max-width: 800px;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    font-weight: 300;
}

.hero-buttons {
    display: flex;
    gap: 20px;
}

/* --- Cards --- */
.card {
    background: var(--white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: var(--transition);
    position: relative;
    border-top: 3px solid transparent;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    border-top-color: var(--primary-red);
}

.card-img {
    height: 200px;
    background-color: var(--gray-light);
    overflow: hidden;
}

.card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

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

.card-body {
    padding: 25px;
}

.card-title {
    font-size: 1.25rem;
    margin-bottom: 10px;
}

/* --- Pricing Table --- */
.pricing-table-container {
    overflow-x: auto;
}

.pricing-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    margin-bottom: 30px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.pricing-table th,
.pricing-table td {
    padding: 15px 20px;
    text-align: left;
    border-bottom: 1px solid var(--gray-light);
}

.pricing-table th {
    background: var(--black);
    color: var(--white);
    font-weight: 600;
    text-transform: uppercase;
}

.pricing-table tr:hover {
    background: #f9f9f9;
}

.price-original {
    text-decoration: line-through;
    color: var(--gray-medium);
    margin-right: 10px;
    font-size: 0.9em;
}

.price-offer {
    color: var(--primary-red);
    font-weight: 700;
    font-size: 1.1em;
}

.discount-badge {
    background: var(--primary-red);
    color: var(--white);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75em;
    font-weight: 600;
}

/* --- Footer --- */
.footer {
    background: var(--black-soft);
    color: var(--gray-light);
    padding: 60px 0 20px;
    font-size: 0.9rem;
}

.footer h3 {
    color: var(--white);
    margin-bottom: 20px;
    font-size: 1.2rem;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a:hover {
    color: var(--primary-red);
    padding-left: 5px;
}

.footer-bottom {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--gray-dark);
    text-align: center;
}

/* --- GSAP Animation Helpers --- */
/* Hero word split needs perspective */
.gsap-hero-content h1 {
    perspective: 500px;
}

/* Hero button pulse glow */
@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(230, 0, 0, 0.4); }
    50% { box-shadow: 0 0 0 15px rgba(230, 0, 0, 0); }
}

.hero-buttons .btn-primary.pulse-active {
    animation: pulse 2s ease-in-out infinite;
}

/* GSAP will-change hints for smooth animations */
.card,
.why-item,
.offer-card,
.footer-col {
    will-change: transform, opacity;
}

/* Why Choose Us - animated numbers */
.why-item {
    text-align: center;
    padding: 30px 20px;
    border-radius: var(--border-radius);
    transition: var(--transition);
    position: relative;
}

.why-item:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-5px);
}

.why-number {
    color: var(--primary-red);
    font-size: 3rem;
    font-weight: 700;
    font-family: var(--font-heading);
    margin-bottom: 15px;
    display: block;
    position: relative;
}

.why-number::after {
    content: '';
    display: block;
    width: 40px;
    height: 3px;
    background: var(--primary-red);
    margin: 10px auto 0;
    transition: width 0.5s ease;
}

.why-item:hover .why-number::after {
    width: 60px;
}

/* Section headings */
.section-heading {
    position: relative;
    display: inline-block;
    --heading-line: 0px;
}

.section-heading::after {
    content: '';
    display: block;
    width: var(--heading-line, 0px);
    height: 3px;
    background: var(--primary-red);
    margin: 15px auto 0;
}

/* CTA Band animation */
.cta-band {
    position: relative;
    overflow: hidden;
}

.cta-band::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 60%);
    animation: ctaShimmer 8s linear infinite;
}

@keyframes ctaShimmer {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Location section animated map marker */
.location-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--white);
    padding: 15px 30px;
    border-radius: 50px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    margin-bottom: 25px;
    font-weight: 600;
    color: var(--black);
}

.location-badge svg {
    animation: bounce 2s ease infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

/* Card hover enhanced */
.card {
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                box-shadow 0.4s ease,
                border-top-color 0.4s ease;
}

.card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0;
    background: linear-gradient(transparent, rgba(230, 0, 0, 0.03));
    transition: height 0.4s ease;
    pointer-events: none;
}

.card:hover::after {
    height: 100%;
}

/* Footer columns - GSAP handles reveal */

/* --- Ramadan Offers Popup --- */
.offers-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.offers-popup.show {
    display: flex;
}

.offers-popup.show .offers-popup-overlay {
    animation: popupFadeIn 0.4s ease forwards;
}

.offers-popup.show .offers-popup-container {
    animation: popupScaleIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.1s forwards;
}

.offers-popup.closing .offers-popup-overlay {
    animation: popupFadeOut 0.3s ease forwards;
}

.offers-popup.closing .offers-popup-container {
    animation: popupScaleOut 0.3s ease forwards;
}

@keyframes popupFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes popupFadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes popupScaleIn {
    from { opacity: 0; transform: scale(0.8) translateY(30px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes popupScaleOut {
    from { opacity: 1; transform: scale(1) translateY(0); }
    to { opacity: 0; transform: scale(0.8) translateY(30px); }
}

.offers-popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 0;
}

.offers-popup-container {
    position: relative;
    width: 90%;
    max-width: 520px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5);
    background: #0a0a0a;
    opacity: 0;
}

.offers-popup-close {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 22px;
    line-height: 36px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
}

.offers-popup-close:hover {
    background: var(--primary-red);
    transform: rotate(90deg);
}

/* Slider */
.offers-popup-slider {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.offers-slide {
    display: none;
    width: 100%;
    animation: popupSlideFadeIn 0.4s ease forwards;
}

.offers-slide.active-slide {
    display: block;
}

@keyframes popupSlideFadeIn {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

.offers-slide img {
    width: 100%;
    height: auto;
    display: block;
}

.offers-slide a {
    display: block;
}

/* Dots */
.offers-popup-dots {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 14px 0;
    background: #0a0a0a;
}

.popup-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #444;
    cursor: pointer;
    transition: all 0.3s ease;
}

.popup-dot.active-dot {
    background: var(--primary-red);
    transform: scale(1.3);
    box-shadow: 0 0 8px rgba(230, 0, 0, 0.5);
}

/* Arrows */
.offers-popup-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-calc(50% + 18px));
    z-index: 5;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.offers-popup-arrow:hover {
    background: var(--primary-red);
}

.offers-popup-prev {
    left: 10px;
}

.offers-popup-next {
    right: 10px;
}

/* Mobile popup */
@media (max-width: 768px) {
    .offers-popup-container {
        width: 92%;
        max-width: 400px;
    }

    .offers-popup-close {
        width: 32px;
        height: 32px;
        font-size: 20px;
        line-height: 32px;
        top: 8px;
        right: 8px;
    }

    .offers-popup-arrow {
        width: 32px;
        height: 32px;
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .offers-popup-container {
        width: 95%;
        border-radius: 12px;
    }
}

/* --- Floating Buttons --- */
.floating-wa {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #25D366;
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 30px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    z-index: 999;
}

.floating-wa:hover {
    transform: scale(1.1);
}

/* --- Mobile Bottom Nav --- */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: var(--white);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 998;
    padding: 10px;
}

@media (max-width: 768px) {
    .mobile-bottom-nav {
        display: flex;
        gap: 10px;
        justify-content: space-between;
    }

    .mobile-bottom-nav .btn {
        flex: 1;
        text-align: center;
        padding: 12px;
        font-size: 0.85rem;
    }

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

/* Internal Page Headers */
.page-header {
    background: var(--internal-header-bg) !important;
    background-size: cover !important;
    background-position: center !important;
    background-attachment: fixed !important;
}

/* --- Responsive & Mobile Styles --- */

/* Large tablets */
@media (max-width: 1024px) {
    .grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)) !important;
    }
}

@media (max-width: 900px) {
    .hero h1 {
        font-size: 2.8rem;
    }

    .section {
        padding: 60px 0;
    }
}

@media (max-width: 768px) {

    /* Layout & Spacing */
    .container {
        width: 92%;
        padding: 0 10px;
    }

    .section {
        padding: 50px 0;
    }

    .grid {
        gap: 20px;
        grid-template-columns: 1fr !important;
    }

    /* Typography */
    .hero h1 {
        font-size: 2rem;
        margin-bottom: 15px;
    }

    .hero p {
        font-size: 0.95rem;
        margin-bottom: 20px;
    }

    h2 {
        font-size: 1.6rem;
    }

    h3 {
        font-size: 1.2rem;
    }

    /* Hero Section */
    .hero {
        min-height: 100svh;
        text-align: center;
        margin-top: 0;
    }

    .hero-content {
        width: 100%;
        padding-top: 70px;
        margin: 0 auto;
    }

    .hero-buttons {
        justify-content: center;
        flex-wrap: wrap;
        gap: 10px;
    }

    .hero-buttons .btn {
        width: 100%;
        max-width: 300px;
        padding: 12px 20px;
        font-size: 0.85rem;
    }

    .hero-trust {
        flex-direction: column;
        gap: 8px !important;
        font-size: 0.85rem !important;
    }

    /* Section headings */
    .section-heading::after {
        margin: 10px auto 0;
    }

    /* Cards */
    .card:hover {
        transform: none;
    }

    .card:hover::after {
        height: 0;
    }

    /* Why Choose Us */
    .why-item {
        padding: 20px 15px;
    }

    .why-number {
        font-size: 2.5rem;
    }

    .why-item:hover {
        transform: none;
    }

    /* Location badge */
    .location-badge {
        padding: 12px 20px;
        font-size: 0.9rem;
    }

    /* CTA Band */
    .cta-band h2 {
        font-size: 1.5rem !important;
    }

    .cta-band p {
        font-size: 1rem !important;
    }

    /* Pricing Table - Mobile Card View */
    .pricing-table thead {
        display: none;
    }

    .pricing-table,
    .pricing-table tbody,
    .pricing-table tr,
    .pricing-table td {
        display: block;
        width: 100%;
    }

    .pricing-table tr {
        margin-bottom: 20px;
        border: 1px solid #eee;
        border-radius: 8px;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
        padding: 15px;
        background: var(--white);
    }

    .pricing-table td {
        text-align: right;
        padding-left: 50%;
        position: relative;
        border-bottom: 1px solid #f4f4f4;
        padding: 10px 0;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .pricing-table td:last-child {
        border-bottom: none;
        justify-content: center;
        padding-top: 15px;
    }

    .pricing-table td::before {
        content: attr(data-label);
        float: left;
        font-weight: 700;
        text-transform: uppercase;
        font-size: 0.85rem;
        color: var(--black);
    }

    /* Filters */
    .filters-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-group {
        flex-direction: column;
        align-items: stretch;
    }

    /* Mobile Bottom Nav */
    .mobile-bottom-nav {
        display: flex;
        gap: 10px;
        justify-content: space-between;
        padding-bottom: max(10px, env(safe-area-inset-bottom));
    }

    .mobile-bottom-nav .btn {
        flex: 1;
        text-align: center;
        padding: 12px;
        font-size: 0.85rem;
    }

    .footer {
        padding-bottom: 80px;
    }

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

    /* WhatsApp floating - move above bottom nav */
    .floating-wa {
        bottom: 80px;
        right: 20px;
        width: 50px;
        height: 50px;
    }
}

/* Small phones */
@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.7rem;
    }

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

    h2 {
        font-size: 1.4rem;
    }

    .section {
        padding: 35px 0;
    }

    .container {
        width: 95%;
    }

    .btn {
        padding: 12px 24px;
        font-size: 0.8rem;
    }

    .card-body {
        padding: 20px;
    }

    .card-img {
        height: 180px;
    }

    .why-number {
        font-size: 2rem;
    }
}

/* Very small phones */
@media (max-width: 360px) {
    .hero h1 {
        font-size: 1.5rem;
    }

    .container {
        width: 96%;
        padding: 0 5px;
    }
}