/* ===================================
   Ceramiques Europa - Responsive Styles
   Mobile-First Optimization
   =================================== */

/* ===================================
   Large Desktop (1400px and up)
   =================================== */
@media (min-width: 1400px) {
    .section-container {
        max-width: 1600px;
    }
}

/* ===================================
   Desktop-Only Contact Layout
   =================================== */
@media (min-width: 993px) {
    /* Reflow contact page so quick stats sit beneath both main cards */
    .contact-grid {
        grid-template-columns: 1.5fr 1fr;
        grid-template-areas:
            "form info"
            "stats stats";
        grid-auto-rows: auto;
    }

    .contact-form-wrapper {
        grid-area: form;
    }

    /* Flatten wrapper so its children can participate directly in the grid
       (mobile/tablet keep original flex layout via narrower breakpoints) */
    .contact-info-wrapper {
        display: contents;
    }

    .contact-info-card {
        grid-area: info;
    }

    .quick-stats {
        grid-area: stats;
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
    }
}

/* ===================================
   Desktop (1200px and below)
   =================================== */
@media (max-width: 1200px) {
    .hero-title {
        font-size: 3.5rem;
    }
    
    .section-title {
        font-size: 2.5rem;
    }
    
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .projects-showcase {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .process-steps {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .areas-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ===================================
   Tablet (992px and below)
   =================================== */
@media (max-width: 992px) {
    /* Navigation */
    .nav-menu {
        /* Anchor dropdown directly under the fixed header on mobile */
        position: absolute;
        left: -100%;
        top: 100%;
        flex-direction: column;
        background-color: rgba(255, 255, 255, 0.98);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.1);
        padding: 2rem 0;
        gap: 0;
    }
    
    .nav-menu.active {
        left: 0;
    }

    /* Ensure mobile dropdown links are always dark on the home page */
    body.home-page #header .nav-menu.active .nav-link {
        color: var(--color-black);
    }

    body.home-page #header .nav-menu.active .lang-link {
        color: var(--color-black);
    }

    body.home-page #header .nav-menu.active .lang-switcher {
        border-color: rgba(0, 0, 0, 0.2);
    }
    
    .nav-item {
        padding: 1rem 0;
        width: 100%;
        border-bottom: 1px solid var(--color-medium-gray);
    }

    .nav-item.nav-lang {
        border-bottom: none;
        padding: 1.25rem 0;
        display: flex;
        justify-content: center;
    }
    
    .nav-link::after {
        display: none;
    }
    
    .hamburger {
        display: flex;
    }
    
    .hamburger.active .bar:nth-child(2) {
        opacity: 0;
    }
    
    .hamburger.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    
    .hamburger.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }
    
    /* Hero */
    .hero {
        height: 80vh;
        min-height: 600px;
    }
    
    .hero-title {
        font-size: 3rem;
    }
    
    .hero-description {
        font-size: 1.1rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        width: 100%;
        max-width: 400px;
    }
    
    .hero-buttons .btn {
        width: 100%;
        justify-content: center;
        text-align: center;
    }
    
    /* Page Hero */
    .page-hero {
        height: 40vh;
        min-height: 300px;
    }
    
    .page-title {
        font-size: 3rem;
    }
    
    /* Sections */
    .section-container {
        padding: 4rem 2rem;
    }
    
    .section-title {
        font-size: 2.2rem;
    }
    
    /* About Preview */
    .about-preview-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    
    .about-preview-content {
        padding-right: 0;
    }
    
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
    }
    
    /* Services */
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    /* Projects */
    .projects-showcase {
        grid-template-columns: 1fr;
    }
    
    .project-feature {
        height: 400px;
    }
    
    /* Why Choose Us */
    .why-choose-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    
    .features-list {
        gap: 1.5rem;
    }
    
    .why-choose-images .main-image {
        height: 400px;
    }
    
    /* Process */
    .process-steps {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    /* Testimonials */
    .testimonials-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    /* CTA */
    .cta-background {
        background-attachment: scroll;
    }
    
    .cta-content {
        padding: 3rem 1.5rem;
    }
    
    .cta-title {
        font-size: 2.5rem;
    }
    
    .cta-description {
        font-size: 1.1rem;
    }
    
    .cta-buttons {
        flex-direction: column;
        width: 100%;
        max-width: 400px;
        margin: 0 auto;
        gap: 1rem;
    }
    
    .cta-buttons .btn {
        width: 100%;
    }
    
    /* Footer */
    .footer {
        width: 100%;
        overflow-x: hidden;
    }
    
    .footer-content {
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
    
    .footer-column:first-child {
        grid-column: 1 / -1;
    }
    
    /* About Page */
    .story-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    
    .timeline::before {
        left: 20px;
    }
    
    .timeline-item {
        grid-template-columns: auto 1fr;
        gap: 2rem;
    }
    
    .timeline-item:nth-child(even) .timeline-content,
    .timeline-item:nth-child(odd) .timeline-content {
        grid-column: 2;
        text-align: left;
    }
    
    .timeline-marker {
        grid-column: 1;
    }
    
    .landmark-card {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .landmark-card:nth-child(even) {
        direction: ltr;
    }
    
    .landmark-image {
        height: 300px;
    }
    
    .values-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .expertise-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    
    .expertise-main-image {
        height: 400px;
    }
    
    .expertise-stats {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .why-choose-grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Services Page */
    .service-detail-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    
    .service-detail-grid.reverse {
        direction: ltr;
    }
    
    .service-list {
        grid-template-columns: 1fr;
    }
    
    .service-features {
        grid-template-columns: 1fr;
    }
    
    .additional-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .process-timeline {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    /* Gallery */
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .gallery-item {
        height: 300px;
    }
    
    /* Contact */
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    
    .faq-grid {
        grid-template-columns: 1fr;
    }
}

/* ===================================
   Mobile (768px and below)
   =================================== */
@media (max-width: 768px) {
    /* Typography */
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .hero-description {
        font-size: 1rem;
    }
    
    .page-title {
        font-size: 2.5rem;
    }
    
    .page-subtitle {
        font-size: 1.1rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .section-label {
        font-size: 0.85rem;
    }
    
    /* Hero */
    .hero {
        height: 70vh;
        min-height: 500px;
    }
    
    .hero-scroll {
        bottom: 2rem;
    }
    
    /* Buttons */
    .btn {
        padding: 0.9rem 2rem;
        font-size: 0.95rem;
    }
    
    /* Sections */
    .section-container {
        padding: 3rem 1.5rem;
    }
    
    /* Stats */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .stat-number {
        font-size: 3rem;
    }
    
    /* Images */
    .image-grid-2 {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .grid-image {
        height: 300px;
    }
    
    /* Services */
    .services-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .service-card {
        padding: 2.5rem 2rem;
    }
    
    .service-icon {
        width: 70px;
        height: 70px;
        font-size: 1.8rem;
    }
    
    /* Projects */
    .project-feature {
        height: 350px;
    }
    
    .project-title {
        font-size: 1.5rem;
    }
    
    /* Process */
    .process-steps {
        grid-template-columns: 1fr;
    }
    
    .process-step {
        padding: 2rem 1.5rem;
    }
    
    .step-icon {
        width: 70px;
        height: 70px;
        font-size: 1.8rem;
    }
    
    .step-number {
        font-size: 3rem;
        top: -10px;
        right: 15px;
    }
    
    /* CTA */
    .cta-background {
        min-height: 400px;
        background-attachment: scroll;
    }
    
    .cta-content {
        padding: 3rem 1.5rem;
        max-width: 100%;
    }
    
    .cta-title {
        font-size: 2rem;
        max-width: 100%;
    }
    
    .cta-description {
        font-size: 1rem;
        max-width: 100%;
    }
    
    .cta-buttons {
        width: 100%;
        max-width: 100%;
        padding: 0;
        gap: 1rem;
    }
    
    /* Footer */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .footer-column:first-child {
        grid-column: 1;
    }
    
    .footer-logo {
        font-size: 1.8rem;
    }
    
    /* Back to Top */
    .back-to-top {
        width: 45px;
        height: 45px;
        bottom: 20px;
        right: 20px;
        font-size: 1.2rem;
    }
    
    /* About Page */
    .story-image-grid {
        grid-template-columns: 1fr;
    }
    
    .story-image-grid img {
        height: 300px;
    }
    
    .timeline-year {
        font-size: 1.5rem;
    }
    
    .timeline-title {
        font-size: 1.3rem;
    }
    
    .landmark-image {
        height: 250px;
    }
    
    .landmark-content h3 {
        font-size: 1.5rem;
    }
    
    .values-grid {
        grid-template-columns: 1fr;
    }
    
    .value-card {
        padding: 2.5rem 2rem;
    }
    
    .value-icon {
        width: 70px;
        height: 70px;
        font-size: 1.8rem;
    }
    
    .expertise-main-image {
        height: 300px;
    }
    
    .expertise-stats {
        grid-template-columns: 1fr;
    }
    
    .why-choose-grid-3 {
        grid-template-columns: 1fr;
    }
    
    .why-icon {
        width: 60px;
        height: 60px;
        font-size: 1.6rem;
    }
    
    /* Services Page */
    .service-badge {
        width: 80px;
        height: 80px;
        font-size: 2rem;
    }
    
    .service-detail-title {
        font-size: 2rem;
    }
    
    .service-subtitle {
        font-size: 1.3rem;
    }
    
    .service-main-img {
        height: 300px;
    }
    
    .service-secondary-img {
        height: 200px;
    }
    
    .additional-grid {
        grid-template-columns: 1fr;
    }
    
    .additional-image {
        height: 200px;
    }
    
    /* Gallery */
    .gallery-filter {
        gap: 0.8rem;
        padding: 0 1.5rem;
    }
    
    .filter-btn {
        padding: 0.7rem 1.5rem;
        font-size: 0.85rem;
    }
    
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 0 1.5rem;
    }
    
    .gallery-item {
        height: 350px;
    }
    
    .gallery-info h3 {
        font-size: 1.2rem;
    }
    
    .gallery-zoom {
        width: 45px;
        height: 45px;
        font-size: 1.2rem;
    }
    
    /* Lightbox */
    .lightbox-image {
        max-width: 95%;
        max-height: 85%;
    }
    
    .lightbox-close,
    .lightbox-prev,
    .lightbox-next {
        width: 45px;
        height: 45px;
        font-size: 1.3rem;
    }
    
    .lightbox-close {
        top: 15px;
        right: 15px;
    }
    
    .lightbox-prev {
        left: 10px;
    }
    
    .lightbox-next {
        right: 10px;
    }
    
    /* Contact */
    .contact-form-wrapper {
        padding: 2rem;
    }
    
    .form-title {
        font-size: 1.8rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .contact-info-card {
        padding: 2rem 1.5rem;
    }
    
    .info-title {
        font-size: 1.8rem;
    }
    
    .info-icon {
        width: 50px;
        height: 50px;
        font-size: 1.3rem;
    }
    
    .areas-grid {
        grid-template-columns: 1fr;
    }
    
    .area-card {
        padding: 2rem 1.5rem;
    }
    
    .area-card i {
        font-size: 2rem;
    }
    
    .area-card h3 {
        font-size: 1.3rem;
    }
    
    .faq-question i {
        font-size: 1.3rem;
    }
    
    .faq-question h3 {
        font-size: 1.1rem;
    }
}

/* ===================================
   Small Mobile (576px and below)
   =================================== */
@media (max-width: 576px) {
    /* Header */
    .logo h1 {
        font-size: 1.5rem;
    }
    
    .navbar {
        padding: 1rem 0;
    }
    
    .nav-container {
        padding: 0 1.5rem;
    }
    
    /* Hero */
    .hero {
        height: 60vh;
        min-height: 450px;
    }
    
    .hero-title {
        font-size: 2rem;
        margin-bottom: 1rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .hero-description {
        font-size: 0.95rem;
        margin-bottom: 2rem;
    }
    
    .hero-buttons {
        gap: 1rem;
    }
    
    /* Page Hero */
    .page-hero {
        height: 35vh;
        min-height: 250px;
    }
    
    .page-title {
        font-size: 2rem;
    }
    
    .page-subtitle {
        font-size: 1rem;
    }
    
    /* Typography */
    .section-title {
        font-size: 1.8rem;
    }
    
    .section-label {
        font-size: 0.8rem;
        letter-spacing: 2px;
    }
    
    .section-description,
    .section-text {
        font-size: 1rem;
    }
    
    /* Buttons */
    .btn {
        padding: 0.8rem 1.5rem;
        font-size: 0.9rem;
    }
    
    /* Sections */
    .section-container {
        padding: 2.5rem 1rem;
    }
    
    .section-header {
        margin-bottom: 2.5rem;
    }
    
    /* Stats */
    .stat-number {
        font-size: 2.5rem;
    }
    
    .stat-label {
        font-size: 0.85rem;
    }
    
    /* Services */
    .service-card {
        padding: 2rem 1.5rem;
    }
    
    .service-title {
        font-size: 1.3rem;
    }
    
    .service-description {
        font-size: 0.95rem;
    }
    
    /* Projects */
    .project-feature {
        height: 300px;
    }
    
    .project-title {
        font-size: 1.3rem;
    }
    
    .project-overlay {
        padding: 1.5rem;
    }
    
    /* Features */
    .feature-item {
        flex-direction: column;
        text-align: center;
    }
    
    .feature-icon {
        width: 50px;
        height: 50px;
        font-size: 1.3rem;
        margin: 0 auto;
    }
    
    .feature-content h4 {
        font-size: 1.2rem;
    }
    
    /* Process */
    .process-step {
        padding: 1.5rem 1rem;
    }
    
    .step-number {
        font-size: 2.5rem;
        right: 10px;
    }
    
    .step-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
    
    .step-title {
        font-size: 1.2rem;
    }
    
    /* Testimonials */
    .testimonial-card {
        padding: 2rem 1.5rem;
    }
    
    .testimonial-text {
        font-size: 1rem;
    }
    
    .testimonial-author h4 {
        font-size: 1rem;
    }
    
    /* CTA */
    .cta-background {
        min-height: 350px;
    }
    
    .cta-content {
        padding: 3rem 1.5rem;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .cta-title {
        font-size: 1.8rem;
        max-width: 100%;
        padding: 0 0.5rem;
    }
    
    .cta-description {
        font-size: 0.95rem;
        max-width: 100%;
        padding: 0 0.5rem;
    }
    
    .cta-buttons {
        width: 100%;
        max-width: 100%;
        padding: 0 0.5rem;
        box-sizing: border-box;
    }
    
    /* Footer */
    .footer {
        padding: 3rem 0 1.5rem;
    }
    
    .footer-logo {
        font-size: 1.6rem;
    }

    .footer-bottom-inner {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 0.5rem;
    }
    
    .footer-title {
        font-size: 1.1rem;
    }
    
    .social-link {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }
    
    /* About Page */
    .timeline::before {
        left: 10px;
    }
    
    .timeline-item {
        gap: 1.5rem;
    }
    
    .timeline-year {
        font-size: 1.3rem;
    }
    
    .timeline-title {
        font-size: 1.2rem;
    }
    
    .timeline-description {
        font-size: 0.95rem;
    }
    
    .landmark-content h3 {
        font-size: 1.3rem;
    }
    
    .value-title {
        font-size: 1.2rem;
    }
    
    /* Services Page */
    .service-badge {
        width: 70px;
        height: 70px;
        font-size: 1.8rem;
    }
    
    .service-detail-title {
        font-size: 1.8rem;
    }
    
    .service-subtitle {
        font-size: 1.2rem;
    }
    
    .service-detail-text {
        font-size: 1rem;
    }
    
    .feature-box {
        padding: 1.5rem 1rem;
    }
    
    .feature-box i {
        font-size: 1.8rem;
    }
    
    .feature-box h4 {
        font-size: 1rem;
    }
    
    .feature-box p {
        font-size: 0.9rem;
    }
    
    .additional-content {
        padding: 1.5rem;
    }
    
    .additional-content h3 {
        font-size: 1.2rem;
    }
    
    .process-item {
        flex-direction: column;
        text-align: center;
    }
    
    .process-icon {
        margin: 0 auto;
    }
    
    .process-content h3 {
        font-size: 1.2rem;
    }
    
    /* Gallery */
    .gallery-item {
        height: 300px;
    }
    
    .gallery-info h3 {
        font-size: 1.1rem;
    }
    
    .gallery-info p {
        font-size: 0.85rem;
    }
    
    /* Contact */
    .contact-form-wrapper {
        padding: 1.5rem;
    }
    
    .form-title {
        font-size: 1.6rem;
    }
    
    .contact-info-card {
        padding: 1.5rem;
    }
    
    .info-title {
        font-size: 1.6rem;
    }
    
    .info-item {
        flex-direction: column;
        text-align: center;
    }
    
    .info-icon {
        margin: 0 auto;
    }
    
    .stat-box {
        padding: 1.5rem;
    }
    
    .stat-box i {
        font-size: 2rem;
    }
    
    .stat-box h4 {
        font-size: 1.1rem;
    }
    
    .area-card h3 {
        font-size: 1.2rem;
    }
    
    .faq-item {
        padding: 1.5rem;
    }
    
    .faq-question {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .faq-question h3 {
        font-size: 1rem;
    }
    
    .faq-answer p {
        font-size: 0.95rem;
    }
}

/* ===================================
   Extra Small Mobile (480px and below)
   =================================== */
@media (max-width: 480px) {
    .hero-title {
        font-size: 1.8rem;
    }
    
    .page-title {
        font-size: 1.8rem;
    }
    
    .section-title {
        font-size: 1.6rem;
    }
    
    .cta-title {
        font-size: 1.6rem;
    }
    
    .btn {
        padding: 0.7rem 1.2rem;
        font-size: 0.85rem;
    }
    
    .gallery-item {
        height: 250px;
    }
    
    .project-feature {
        height: 250px;
    }
}

/* ===================================
   Custom Mobile-Only Adjustments
   =================================== */

/* Ensure home hero fills full viewport height on initial load (mobile only) */
@media (max-width: 768px) {
    body.home-page .hero {
        height: 100vh;
        min-height: 100vh;
    }
}

/* Center "Discover Our Story" button on homepage on mobile only */
@media (max-width: 768px) {
    body.home-page .about-preview-content {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    body.home-page .about-preview-content .btn.btn-outline {
        align-self: center;
    }
}

/* Center text/content inside CTA buttons at bottom of all pages on mobile only */
@media (max-width: 768px) {
    .cta-buttons .btn {
        justify-content: center;
        text-align: center;
    }
}

/* ===================================
   Print Styles
   =================================== */
@media print {
    .navbar,
    .hero-scroll,
    .back-to-top,
    .hamburger,
    .cta-section,
    .contact-form-wrapper {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.5;
        color: #000;
    }
    
    .section-container {
        padding: 1rem;
    }
    
    .page-hero {
        height: auto;
        min-height: 150px;
        page-break-after: avoid;
    }
    
    h1, h2, h3 {
        page-break-after: avoid;
    }
    
    img {
        max-width: 100%;
        page-break-inside: avoid;
    }
    
    a {
        text-decoration: underline;
    }
    
    .footer {
        page-break-before: always;
    }
}

