/* ========================================
   Mallorca CarKeeper - Premium Styles
   ======================================== */

/* CSS Custom Properties */
:root {
    /* Colors - Mediterranean Premium */
    --color-primary: #1A1A1A;
    --color-secondary: #4A4A4A;
    --color-accent: #A8A29E;
    --color-background: #F5F5F0;
    --color-surface: #FFFFFF;
    --color-border: #E5E5E0;
    --color-border-hover: #D4D4D0;
    --color-success: #166534;
    --color-error: #991B1B;
    
    /* Typography */
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Lato', sans-serif;
    
    /* Spacing */
    --header-height: 80px;
    --section-padding: clamp(4rem, 8vw, 8rem);
    --container-padding: clamp(1.5rem, 4vw, 3rem);
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-base: 0.3s ease;
    --transition-slow: 0.5s ease;
    
    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.12);
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--header-height);
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

body {
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: 400;
    line-height: 1.6;
    color: var(--color-primary);
    background-color: var(--color-background);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 400;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: var(--color-primary);
}

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

a:hover {
    color: var(--color-secondary);
}

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

/* Focus States */
*:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* Selection */
::selection {
    background-color: var(--color-primary);
    color: var(--color-surface);
}

/* Container */
.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

.container--narrow {
    max-width: 800px;
}

/* Section */
.section {
    padding: var(--section-padding) 0;
}

.section--alt {
    background-color: var(--color-surface);
}

.section__label {
    display: block;
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 400;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--color-accent);
    margin-bottom: 1rem;
}

.section__title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    margin-bottom: 2rem;
}

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

/* Divider */
.divider {
    width: 80%;
    max-width: 1000px;
    height: 1px;
    background-color: var(--color-border);
    margin: 0 auto;
}

/* ========================================
   Header
   ======================================== */

.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 1.5rem 0;
    transition: all var(--transition-base);
}

.header.scrolled {
    padding: 0.75rem 0;
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: var(--shadow-sm);
}

.header__container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--container-padding);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header__logo {
    position: relative;
    z-index: 101;
}

.header__logo img {
    height: 40px;
    width: auto;
    transition: opacity var(--transition-base);
}

.header__logo-dark {
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
}

.header.scrolled .header__logo-white {
    opacity: 0;
}

.header.scrolled .header__logo-dark {
    opacity: 1;
}

/* Navigation */
.nav {
    display: none;
}

.nav__list {
    display: flex;
    gap: 2.5rem;
    list-style: none;
}

.nav__link {
    font-size: 0.75rem;
    font-weight: 400;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: white;
    padding: 0.5rem 0;
    position: relative;
    transition: color var(--transition-fast);
}

.nav__link::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    height: 1px;
    background-color: currentColor;
    transition: width var(--transition-fast);
}

.nav__link:hover::after,
.nav__link:focus::after {
    width: 100%;
}

.header.scrolled .nav__link {
    color: var(--color-primary);
}

/* Burger Menu */
.burger {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 28px;
    height: 20px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 101;
}

.burger__line {
    display: block;
    width: 100%;
    height: 2px;
    background-color: white;
    transition: all var(--transition-base);
}

.header.scrolled .burger__line {
    background-color: var(--color-primary);
}

.burger.active .burger__line:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.burger.active .burger__line:nth-child(2) {
    opacity: 0;
}

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

/* Mobile Navigation */
.nav.mobile-open {
    display: flex;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 80%;
    max-width: 320px;
    background-color: var(--color-surface);
    flex-direction: column;
    padding: 6rem 2rem 2rem;
    z-index: 100;
    transform: translateX(100%);
    transition: transform var(--transition-base);
}

.nav.mobile-open.visible {
    transform: translateX(0);
}

.nav.mobile-open .nav__list {
    flex-direction: column;
    gap: 0;
}

.nav.mobile-open .nav__link {
    display: block;
    color: var(--color-primary);
    font-size: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--color-border);
}

/* Overlay */
.overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 99;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
}

.overlay.visible {
    opacity: 1;
    visibility: visible;
}

/* ========================================
   Hero
   ======================================== */

.hero {
    position: relative;
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    overflow: hidden;
}

.hero__background {
    position: absolute;
    inset: 0;
}

.hero__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.15) 0%,
        rgba(0, 0, 0, 0.25) 50%,
        rgba(0, 0, 0, 0.00) 100%
    );
}

.hero__content {
    position: relative;
    z-index: 1;
    max-width: 700px;
    padding: 0 var(--container-padding);
}

.hero__title {
    font-size: clamp(3rem, 10vw, 6rem);
    color: white;
    margin-bottom: 0.5rem;
    letter-spacing: -0.03em;
}

.hero__subtitle {
    font-size: clamp(1.25rem, 3vw, 2rem);
    font-weight: 400;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 1.5rem;
}

.hero__text {
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: rgba(255, 255, 255, 0.85);
    max-width: 500px;
    margin-bottom: 2.5rem;
    line-height: 1.7;
}

.hero__buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.hero__scroll {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.6);
    animation: bounce 2s infinite;
}

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

@media (prefers-reduced-motion: reduce) {
    .hero__scroll {
        animation: none;
    }
}

/* ========================================
   Buttons
   ======================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0.875rem 2rem;
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.25s ease;
}

.btn--primary {
    background-color: var(--color-primary);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn--primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    background-color: #333;
    color: white;
}

.btn--primary:active {
    transform: translateY(0);
    box-shadow: var(--shadow-md);
}

.btn--secondary {
    background-color: transparent;
    color: white;
    border: 1px solid white;
}

.btn--secondary:hover {
    background-color: white;
    color: var(--color-primary);
    transform: translateY(-2px);
}

.btn--secondary:active {
    transform: translateY(0);
}

.btn--full {
    width: 100%;
}

.btn__loading {
    display: none;
}

.btn.loading .btn__text {
    display: none;
}

.btn.loading .btn__loading {
    display: inline;
}

/* Touch device hover fix */
@media (hover: none) and (pointer: coarse) {
    .btn--primary:hover,
    .btn--secondary:hover {
        transform: none;
    }
}

/* ========================================
   About Section
   ======================================== */

.about__grid {
    display: grid;
    gap: 3rem;
}

.about__text {
    font-size: 1.0625rem;
    color: var(--color-secondary);
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

.about__text:last-child {
    margin-bottom: 0;
}

.about__image-wrapper {
    position: relative;
}

.about__image-wrapper::after {
    content: '';
    position: absolute;
    bottom: -1.5rem;
    left: -1.5rem;
    width: 120px;
    height: 120px;
    background-color: var(--color-background);
    z-index: -1;
}

.about__image {
    width: 100%;
    aspect-ratio: 4/5;
    object-fit: cover;
}

/* ========================================
   Why Us Section
   ======================================== */

.why-us__header {
    text-align: center;
    margin-bottom: 3rem;
}

.why-us__content {
    max-width: 700px;
    margin: 0 auto 4rem;
}

.why-us__text {
    font-size: 1.0625rem;
    color: var(--color-secondary);
    line-height: 1.8;
    margin-bottom: 1.5rem;
    text-align: center;
}

.why-us__stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    text-align: center;
}

.stat {
    padding: 2rem 1rem;
}

.stat__number {
    display: block;
    font-family: var(--font-heading);
    font-size: clamp(2.5rem, 5vw, 4rem);
    color: var(--color-primary);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.stat__label {
    font-size: 0.875rem;
    color: var(--color-accent);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* ========================================
   Santiago Section
   ======================================== */

.santiago__grid {
    display: grid;
    gap: 3rem;
}

.santiago__image-wrapper {
    position: relative;
}

.santiago__image-wrapper::after {
    content: '';
    position: absolute;
    bottom: -1.5rem;
    right: -1.5rem;
    width: 120px;
    height: 120px;
    background-color: var(--color-background);
    z-index: -1;
}

.santiago__image {
    width: 100%;
    aspect-ratio: 3/4;
    object-fit: cover;
    max-width: 400px;
    margin: 0 auto;
}

.santiago__subtitle {
    font-family: var(--font-body);
    font-size: 1.125rem;
    font-style: italic;
    color: var(--color-accent);
    margin-bottom: 2rem;
}

.santiago__text {
    font-size: 1.0625rem;
    color: var(--color-secondary);
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

/* ========================================
   Services Section
   ======================================== */

.services__header {
    text-align: center;
    margin-bottom: 4rem;
}

.services__grid {
    display: grid;
    gap: 2rem;
}

.service-card {
    background-color: var(--color-background);
    padding: 2.5rem;
    border: 1px solid transparent;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.service-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-xl);
    border-color: var(--color-border-hover);
}

@media (hover: none) and (pointer: coarse) {
    .service-card:hover {
        transform: none;
        box-shadow: none;
        border-color: transparent;
    }
}

.service-card__icon {
    color: var(--color-accent);
    margin-bottom: 1.5rem;
}

.service-card__title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.service-card__list {
    list-style: none;
    margin-bottom: 1.5rem;
}

.service-card__list li {
    position: relative;
    padding-left: 1.25rem;
    margin-bottom: 0.5rem;
    font-size: 0.9375rem;
    color: var(--color-secondary);
}

.service-card__list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.6em;
    width: 6px;
    height: 1px;
    background-color: var(--color-accent);
}

.service-card__text {
    font-size: 0.9375rem;
    color: var(--color-secondary);
    line-height: 1.7;
}

/* ========================================
   FAQ Section
   ======================================== */

.faq__header {
    text-align: center;
    margin-bottom: 3rem;
}

.faq__list {
    border-top: 1px solid var(--color-border);
}

.faq__item {
    border-bottom: 1px solid var(--color-border);
}

.faq__question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 1.5rem 0;
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 400;
    color: var(--color-primary);
    text-align: left;
    cursor: pointer;
    list-style: none;
    transition: color var(--transition-fast);
}

.faq__question::-webkit-details-marker {
    display: none;
}

.faq__question:hover {
    color: var(--color-secondary);
}

.faq__icon {
    flex-shrink: 0;
    margin-left: 1rem;
    transition: transform var(--transition-fast);
}

.faq__item[open] .faq__icon {
    transform: rotate(180deg);
}

.faq__answer {
    padding-bottom: 1.5rem;
}

.faq__answer p {
    font-size: 0.9375rem;
    color: var(--color-secondary);
    line-height: 1.8;
}

/* ========================================
   Contact Section
   ======================================== */

.contact__grid {
    display: grid;
    gap: 4rem;
}

.contact__text {
    font-size: 1.0625rem;
    color: var(--color-secondary);
    line-height: 1.8;
    margin-bottom: 2.5rem;
}

.contact__details {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.contact__item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.contact__item svg {
    flex-shrink: 0;
    color: var(--color-accent);
    margin-top: 0.25rem;
}

.contact__item strong {
    display: block;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.contact__item p {
    font-size: 0.9375rem;
    color: var(--color-secondary);
    margin: 0;
}

.contact__item a {
    color: var(--color-secondary);
}

.contact__item a:hover {
    color: var(--color-primary);
}

/* Form */
.form {
    background-color: var(--color-background);
    padding: 2.5rem;
}

.form__honeypot {
    position: absolute;
    left: -9999px;
    opacity: 0;
    height: 0;
    width: 0;
    overflow: hidden;
    pointer-events: none;
}

.form__group {
    margin-bottom: 1.5rem;
}

.form__label {
    display: block;
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 0.5rem;
}

.form__label .required {
    color: var(--color-error);
}

.form__input,
.form__textarea {
    width: 100%;
    padding: 0.875rem 0;
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--color-primary);
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--color-accent);
    transition: border-color var(--transition-fast);
}

.form__input:focus,
.form__textarea:focus {
    outline: none;
    border-bottom-color: var(--color-primary);
}

.form__input::placeholder,
.form__textarea::placeholder {
    color: var(--color-accent);
}

.form__textarea {
    resize: vertical;
    min-height: 120px;
}

.form__error {
    display: block;
    font-size: 0.8125rem;
    color: var(--color-error);
    margin-top: 0.5rem;
}

.form__input.error,
.form__textarea.error {
    border-bottom-color: var(--color-error);
}

.form__message {
    margin-top: 1.5rem;
    padding: 1rem;
    font-size: 0.9375rem;
    display: none;
    text-align: center;
}

.form__message.success {
    display: block;
    background-color: #dcfce7;
    color: var(--color-success);
    border: 1px solid #86efac;
}

.form__message.error {
    display: block;
    background-color: #fee2e2;
    color: var(--color-error);
    border: 1px solid #fca5a5;
}

/* ========================================
   Footer
   ======================================== */

.footer {
    background-color: var(--color-primary);
    padding: 4rem 0 2rem;
    color: rgba(255, 255, 255, 0.7);
}

.footer__grid {
    display: grid;
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer__logo {
    height: 36px;
    width: auto;
    margin-bottom: 1rem;
}

.footer__tagline {
    font-size: 0.9375rem;
    line-height: 1.6;
}

.footer__title {
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: white;
    margin-bottom: 1rem;
}

.footer__address {
    font-style: normal;
    font-size: 0.9375rem;
    line-height: 1.8;
}

.footer__address a {
    color: rgba(255, 255, 255, 0.7);
}

.footer__address a:hover {
    color: white;
}

.footer__list {
    list-style: none;
    font-size: 0.9375rem;
    line-height: 2;
}

.footer__list a {
    color: rgba(255, 255, 255, 0.7);
}

.footer__list a:hover {
    color: white;
}

.footer__bottom {
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.footer__copyright {
    font-size: 0.875rem;
}

/* ========================================
   SEO Hidden Content
   ======================================== */

.seo-content {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* ========================================
   Animations
   ======================================== */

.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
    .fade-in {
        opacity: 1;
        transform: none;
    }
}

/* ========================================
   Responsive Styles
   ======================================== */

/* 480px and up */
@media (min-width: 480px) {
    .hero__content {
        padding-left: 3rem;
    }
}

/* 768px and up */
@media (min-width: 768px) {
    .nav {
        display: flex;
    }
    
    .burger {
        display: none;
    }
    
    .about__grid {
        grid-template-columns: 1fr 1fr;
        gap: 4rem;
        align-items: center;
    }
    
    .santiago__grid {
        grid-template-columns: 1fr 1.2fr;
        gap: 4rem;
        align-items: center;
    }
    
    .santiago__image {
        max-width: none;
    }
    
    .services__grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .contact__grid {
        grid-template-columns: 1fr 1fr;
        gap: 4rem;
    }
    
    .footer__grid {
        grid-template-columns: 2fr 1fr 1fr 1fr;
        gap: 2rem;
    }
}

/* 1024px and up */
@media (min-width: 1024px) {
    .header__logo img {
        height: 48px;
    }
    
    .hero__content {
        padding-left: 6rem;
    }
    
    .about__grid {
        gap: 5rem;
    }
    
    .santiago__grid {
        gap: 5rem;
    }
    
    .services__grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .form {
        padding: 3rem;
    }
}

/* 1440px and up */
@media (min-width: 1440px) {
    .hero__content {
        padding-left: 8rem;
        max-width: 800px;
    }
    
    .about__grid,
    .santiago__grid {
        gap: 6rem;
    }
}
