/* Fixifier - Main Stylesheet */

/* ===================================
   PERFORMANCE & CORE WEB VITALS
=================================== */

/* Prevent text size adjustment on mobile */
html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-behavior: smooth;
}

/* Prevent layout shift for images (CLS fix) */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Optimize button tap targets for mobile (min 44px) */
button, .btn, a.btn, input[type="submit"], input[type="button"] {
    min-height: 44px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

/* Prevent layout shift for hero slider (CLS fix) */
.hero-slider {
    min-height: 280px;
    background: #1b1b1b;
    contain: layout;
}

/* Skeleton loading animation */
@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Reduce input zoom on iOS (font-size >= 16px) */
input, select, textarea {
    font-size: 16px;
}

:root {
    --primary-yellow: #ffcd00;
    --dark: #1b1b1b;
    --white: #ffffff;
    --light-gray: #f5f5f5;
    --medium-gray: #666666;
    --shadow: rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--dark);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Header */
.header {
    background: var(--primary-yellow);
    box-shadow: 0 2px 10px var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
}

.logo {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--dark);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-image {
    height: 50px;
    width: auto;
    object-fit: contain;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: var(--dark);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: var(--primary-yellow);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.nav-menu a {
    text-decoration: none;
    color: var(--dark);
    font-weight: 600;
    transition: all 0.3s;
    position: relative;
    padding: 0.5rem 1rem;
    border-radius: 5px;
}

.nav-menu a:hover {
    background: var(--dark);
    color: var(--primary-yellow);
}

.nav-menu a.active {
    background: var(--dark);
    color: var(--white);
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: var(--dark);
    transition: width 0.3s;
}

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

.mobile-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--dark);
}

/* Hero Slider */
.hero-slider {
    position: relative;
    height: 500px;
    overflow: hidden;
    background: var(--dark);
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slide.active {
    opacity: 1;
}

.slide-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.6);
}

.slide-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: var(--white);
    max-width: 800px;
    padding: 2rem;
}

.slide-content h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    animation: slideInDown 0.8s;
}

.slide-content h2 {
    font-size: 1.5rem;
    color: var(--primary-yellow);
    margin-bottom: 1rem;
    animation: slideInUp 0.8s;
}

.slide-content p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    animation: fadeIn 1s;
}

.btn {
    display: inline-block;
    padding: 0.8rem 2rem;
    background: var(--primary-yellow);
    color: var(--dark);
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    transition: all 0.3s;
    border: 2px solid var(--primary-yellow);
    cursor: pointer;
    font-size: 1rem;
}

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

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

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

.slider-controls {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 1rem;
    z-index: 3;
}

.slider-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s;
}

.slider-dot.active {
    background: var(--primary-yellow);
    width: 30px;
    border-radius: 6px;
}

/* Section */
.section {
    padding: 4rem 2rem;
}

@media (max-width: 768px) {
    .section {
        padding: 2.75rem 1rem;
    }
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background: var(--primary-yellow);
    margin: 1rem auto;
    border-radius: 2px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Services Section */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

/* Service Categories */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.category-card {
    background: var(--white);
    border-radius: 15px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 5px 20px var(--shadow);
    transition: all 0.3s;
    cursor: pointer;
    border: 3px solid transparent;
}

.category-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
    border-color: var(--primary-yellow);
}

.category-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-yellow), #ffd700);
    border-radius: 50%;
    box-shadow: 0 10px 20px rgba(255, 205, 0, 0.3);
}

.category-icon i {
    font-size: 3rem;
    color: var(--dark);
}

.category-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--dark);
}

.category-card p {
    color: var(--medium-gray);
    margin-bottom: 1.5rem;
}

.category-stats {
    display: flex;
    justify-content: space-between;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--light-gray);
}

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

.stat-number {
    display: block;
    font-weight: bold;
    color: var(--primary-yellow);
    font-size: 1.2rem;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--medium-gray);
}

/* Category Services View */
.category-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.back-btn {
    background: var(--primary-yellow);
    color: var(--dark);
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.back-btn:hover {
    background: var(--dark);
    color: var(--primary-yellow);
    transform: translateX(-5px);
}

#category-title {
    color: var(--dark);
    font-size: 1.8rem;
    margin: 0;
}

.service-card {
    background: var(--white);
    border-radius: 10px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 5px 20px var(--shadow);
    transition: all 0.3s;
    cursor: pointer;
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.service-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--light-gray);
    border-radius: 50%;
}

.service-icon img {
    width: 50px;
    height: 50px;
    object-fit: contain;
}

/* Custom Appliance Clipart Styling */
.appliance-clipart {
    width: 60px;
    height: 60px;
    object-fit: contain;
    filter: brightness(0) saturate(100%) invert(0%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(7%) contrast(100%);
}

.service-clipart {
    width: 50px;
    height: 50px;
    object-fit: contain;
    filter: brightness(0) saturate(100%) invert(0%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(7%) contrast(100%);
}

/* Hover effects for category icons */
.category-card:hover .appliance-clipart {
    filter: brightness(0) saturate(100%) invert(88%) sepia(58%) saturate(2053%) hue-rotate(359deg) brightness(107%) contrast(101%);
    transform: scale(1.1);
    transition: all 0.3s ease;
}

.service-card h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.service-price {
    font-size: 1.8rem;
    color: var(--primary-yellow);
    font-weight: bold;
    margin: 1rem 0;
}

.service-warranty {
    display: inline-block;
    padding: 0.3rem 1rem;
    background: var(--primary-yellow);
    color: var(--dark);
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.service-features {
    list-style: none;
    text-align: left;
    margin: 1rem 0;
}

.service-features li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--light-gray);
}

.service-features li:before {
    content: "✓";
    color: var(--primary-yellow);
    font-weight: bold;
    margin-right: 0.5rem;
}

/* Price Comparison Table (Sleeker) */
.comparison-table {
    background: var(--white);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 20px var(--shadow);
    margin: 2rem 0;
}

.comparison-table table {
    width: 100%;
    border-collapse: collapse;
}

.comparison-table th {
    background: var(--dark);
    color: var(--white);
    padding: 0.9rem;
    text-align: left;
    font-weight: 700;
}

.comparison-table th.fixifier-col {
    background: var(--primary-yellow);
    color: var(--dark);
}

.comparison-table th.competitor-col {
    background: #2f2f2f;
    color: var(--white);
}

.comparison-table td {
    padding: 0.85rem;
    border-bottom: 1px solid var(--light-gray);
    text-align: left;
}

.comparison-table tr:hover {
    background: var(--light-gray);
}

.fixifier-price {
    color: var(--dark);
    font-weight: 800;
}

.competitor-price {
    color: var(--medium-gray);
}

/* Price Highlights */
.price-highlights {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.highlight-box {
    text-align: center;
    padding: 1.5rem;
    background: var(--white);
    border-radius: 8px;
    box-shadow: 0 3px 15px var(--shadow);
    border-top: 4px solid var(--primary-yellow);
}

.highlight-box i {
    font-size: 2.5rem;
    color: var(--primary-yellow);
    margin-bottom: 1rem;
}

.highlight-box h3 {
    color: var(--dark);
    margin-bottom: 0.5rem;
}

.highlight-box p {
    color: var(--medium-gray);
    font-size: 0.9rem;
}

/* Why Choose Us */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.feature-card {
    text-align: center;
    padding: 2rem;
    background: var(--light-gray);
    border-radius: 10px;
    transition: all 0.3s;
}

.feature-card:hover {
    background: var(--primary-yellow);
    transform: scale(1.05);
}

.feature-icon {
    font-size: 3rem;
    color: var(--primary-yellow);
    margin-bottom: 1rem;
}

.feature-card:hover .feature-icon {
    color: var(--dark);
}

.feature-card h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

/* Call CTA */
.call-cta {
    background: var(--white);
    border-radius: 14px;
    box-shadow: 0 10px 30px var(--shadow);
    padding: 1.4rem 1.6rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    border-left: 6px solid var(--primary-yellow);
}

@media (max-width: 768px) {
    .call-cta {
        flex-direction: column;
        text-align: center;
        padding: 1.2rem;
    }
    .call-cta .btn {
        width: 100%;
        justify-content: center;
    }
}

/* History */
.history-box {
    background: var(--white);
    border-radius: 14px;
    box-shadow: 0 10px 30px var(--shadow);
    padding: 2rem;
    border-top: 6px solid var(--primary-yellow);
}

.history-box p {
    color: var(--medium-gray);
    line-height: 1.8;
}

/* Footer */
.footer {
    background: var(--dark);
    color: var(--white);
    padding: 3rem 2rem 1rem;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    color: var(--primary-yellow);
    margin-bottom: 1rem;
}

.footer-menu {
    list-style: none;
}

.footer-menu li {
    margin-bottom: 0.5rem;
}

.footer-menu a {
    color: var(--white);
    text-decoration: none;
    transition: color 0.3s;
}

.footer-menu a:hover {
    color: var(--primary-yellow);
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.social-links a {
    width: 40px;
    height: 40px;
    background: var(--primary-yellow);
    color: var(--dark);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    text-decoration: none;
    transition: all 0.3s;
}

.social-links a:hover {
    background: var(--white);
    transform: scale(1.1);
}

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

/* Cart Badge */
.cart-badge {
    position: relative;
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--primary-yellow);
    color: var(--dark);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: bold;
}

/* Animations */
@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

/* Responsive */
@media (max-width: 768px) {
    /* Header: center logo on mobile */
    .header-container {
        position: relative;
        justify-content: center;
        padding: 0.8rem 1rem;
    }

    .logo {
        margin: 0 auto;
        justify-content: center;
    }

    .logo-image {
        height: 42px;
    }

    .mobile-toggle {
        display: block;
        position: absolute;
        right: 1rem;
        top: 50%;
        transform: translateY(-50%);
        background: rgba(27,27,27,0.1);
        border-radius: 10px;
        padding: 0.6rem 0.7rem;
    }

    .nav-menu {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--white);
        flex-direction: column;
        padding: 1rem;
        box-shadow: 0 5px 10px var(--shadow);
        display: none;
    }

    .nav-menu.active {
        display: flex;
    }

    .slide-content h1 {
        font-size: 1.6rem;
        margin-bottom: 0.5rem;
    }

    .slide-content h2 {
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }

    .slide-content p {
        font-size: 0.9rem;
        margin-bottom: 1.2rem;
    }

    .hero-slider {
        height: auto;
        min-height: 280px;
    }

    .slide {
        min-height: 280px;
    }

    .slide-content {
        padding: 1.2rem;
    }

    .section-title {
        font-size: 2rem;
    }

    /* Services cards: back to 1 per row on mobile for readability */
    .services-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .service-card {
        min-width: 0;
    }

    /* Why Choose Us: make it a swipeable slider on mobile */
    .features-grid {
        display: flex;
        gap: 1rem;
        overflow-x: auto;
        padding: 0.5rem 0.5rem 1.2rem;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
    }

    .feature-card {
        min-width: 78%;
        max-width: 78%;
        scroll-snap-align: start;
        flex: 0 0 auto;
        padding: 1.5rem 1.2rem;
    }

    /* Styled scrollbar for features */
    .features-grid::-webkit-scrollbar {
        height: 5px;
    }

    .features-grid::-webkit-scrollbar-track {
        background: #f0f0f0;
        border-radius: 999px;
    }

    .features-grid::-webkit-scrollbar-thumb {
        background: #ffcd00;
        border-radius: 999px;
    }

    .service-card {
        padding: 1.25rem;
        border-radius: 12px;
    }

    .service-card:hover {
        transform: translateY(-4px);
    }

    .service-icon {
        width: 72px;
        height: 72px;
        margin-bottom: 0.75rem;
    }

    .service-card h3 {
        font-size: 1.15rem;
        line-height: 1.2;
    }

    .service-card p {
        display: block;
        font-size: 0.95rem;
        color: var(--medium-gray);
        margin-top: 0.4rem;
    }

    .service-price {
        font-size: 1.35rem;
        margin: 0.75rem 0;
    }

    .service-warranty {
        font-size: 0.85rem;
        padding: 0.28rem 0.75rem;
        margin-bottom: 0.9rem;
    }

    .service-features {
        display: block;
        margin: 0.8rem 0 1rem;
    }

    .service-features li {
        font-size: 0.92rem;
    }

    .service-card .btn {
        padding: 0.7rem 0.9rem;
        font-size: 0.95rem;
        width: 100%;
    }

    /* Category cards: show 2 columns on mobile */
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .category-card {
        padding: 1.25rem;
    }

    .category-icon {
        width: 75px;
        height: 75px;
        margin-bottom: 1rem;
    }

    .category-icon i,
    .category-icon img {
        width: 42px;
        height: 42px;
        font-size: 2.2rem;
    }

    .category-card h3 {
        font-size: 1.2rem;
        margin-bottom: 0.5rem;
    }

    .category-card p {
        font-size: 0.85rem;
        margin-bottom: 0;
    }

    /* Price comparison table: make it fit better on mobile */
    .comparison-table table {
        min-width: 0;
    }

    .comparison-table th,
    .comparison-table td {
        padding: 0.75rem;
        font-size: 0.9rem;
        white-space: normal;
    }

    .comparison-table th:nth-child(1),
    .comparison-table td:nth-child(1) {
        width: 44%;
    }

    .comparison-table th:nth-child(2),
    .comparison-table td:nth-child(2),
    .comparison-table th:nth-child(3),
    .comparison-table td:nth-child(3) {
        width: 28%;
    }

    /* (Legacy) */
    .price-table {
        overflow-x: auto;
    }
}

@media (max-width: 420px) {
    /* Very small screens: keep categories 2 columns */
    .categories-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.75rem;
    }

    .category-card {
        padding: 1rem;
    }

    .category-icon {
        width: 68px;
        height: 68px;
    }

    .category-card h3 {
        font-size: 1.05rem;
    }

    .category-card p {
        font-size: 0.8rem;
    }

    /* Services: keep 1 column on very small screens */
    .services-grid {
        grid-template-columns: 1fr;
    }

    /* Why Choose Us slider cards a bit wider on small phones */
    .feature-card {
        min-width: 85%;
        max-width: 85%;
    }
}

/* Modal (frontend) */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 9999;
    padding: 1.25rem;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

/* Loading Spinner */
.spinner {
    border: 3px solid var(--light-gray);
    border-top: 3px solid var(--primary-yellow);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}

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

/* Alert Messages */
.alert {
    padding: 1rem;
    border-radius: 5px;
    margin: 1rem 0;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffc107;
}

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

.btn-outline:hover {
    background: var(--dark);
    color: var(--primary-yellow);
}
