:root {
    --navy: #201d38;
    --bg: #f8f9fa;
    --text-gray: #6c757d;
}

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

body {
    font-family: 'Poppins', sans-serif;
    background: var(--bg);
    color: var(--navy);
    min-height: 100svh;
    display: grid;
    grid-template-rows: 1fr auto;
    padding: clamp(1rem, 4vw, 2rem);
    padding-bottom: calc(env(safe-area-inset-bottom) + 1rem);
}

.main-content {
    max-width: 1100px;
    width: 100%;
    margin: auto;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem 0;
}

.logo {
    width: clamp(180px, 45vw, 320px);
    height: auto;
    margin-bottom: clamp(1.5rem, 4vw, 2rem);
    max-width: 100%;
}

h1 {
    font-size: clamp(1.5rem, 5vw, 3rem);
    font-weight: 600;
    margin-bottom: 0.2rem;
    letter-spacing: 0.05em;
    word-wrap: break-word;
}

.subtitle {
    font-size: clamp(0.9rem, 3.5vw, 1.1rem);
    color: var(--text-gray);
    margin-bottom: clamp(2rem, 6vw, 4rem);
    line-height: 1.6;
    max-width: 90%;
}

.products {
    margin-bottom: clamp(2rem, 5vw, 3rem);
    width: 100%;
}

.products h2 {
    font-size: clamp(1.2rem, 4vw, 1.6rem);
    font-weight: 600;
    margin-bottom: 0.2rem;
}

.products-description {
    font-size: clamp(0.85rem, 2.5vw, 0.95rem);
    color: var(--text-gray);
    margin-bottom: clamp(1rem, 4vw, 2rem);
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: clamp(0.8rem, 3vw, 1.5rem);
    max-width: 900px;
    margin: 0 auto;
    padding: 0 clamp(0.5rem, 2vw, 1rem);
}

@media screen and (max-width: 480px) {
    .product-grid {
        grid-template-columns: 1fr;
        gap: 1.2rem;
        max-width: 350px;
    }
    
    .product-link {
        min-height: 80px;
    }
    
    .product-link img {
        max-width: 200px;
        max-height: 100px;
    }
}

.product-link {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: transform 0.3s ease, opacity 0.3s ease;
    padding: 0.5rem;
    min-height: 60px;
}

.product-link img {
    width: 140%;
    max-width: 140%;
    height: auto;
    max-height: 100%;
    object-fit: contain;
}

@media (hover: hover) and (pointer: fine) {
    .product-link:hover {
        transform: scale(1.08);
        opacity: 0.85;
    }
}

.product-link:active {
    transform: scale(0.95);
    opacity: 0.7;
}

.bottom-section {
    text-align: center;
    margin-top: 1rem;
    padding: 0 1rem;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.2rem;
    flex-wrap: wrap;
}

.social-link {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1.5px solid #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-gray);
    transition: all 0.2s ease;
    text-decoration: none;
    flex-shrink: 0;
}

@media (hover: hover) and (pointer: fine) {
    .social-link:hover {
        border-color: var(--navy);
        background: var(--navy);
        color: #fff;
        transform: translateY(-2px);
    }
}

.social-link:active {
    transform: scale(0.9);
}

.footer {
    font-size: clamp(0.75rem, 2.5vw, 0.85rem);
    color: var(--text-gray);
}

@media screen and (max-width: 480px) {
    body {
        padding: 1rem 0.75rem;
    }
    
    .main-content {
        padding: 0.5rem 0;
    }
    
    .logo {
        width: min(200px, 60vw);
    }
    
    h1 {
        font-size: 1.5rem;
        letter-spacing: 0.03em;
    }
    
    .subtitle {
        font-size: 0.9rem;
        margin-bottom: 1.5rem;
    }
    
    .product-grid {
        grid-template-columns: 1fr;
        gap: 1.2rem;
        padding: 0;
        max-width: 320px;
    }
    
    .product-link {
        padding: 0.6rem;
        min-height: 80px;
    }
    
    .product-link img {
        max-width: 180px;
        max-height: 90px;
    }
    
    .products h2 {
        font-size: 1.2rem;
    }
    
    .products-description {
        font-size: 0.85rem;
        margin-bottom: 1.5rem;
    }
}

@media screen and (min-width: 481px) and (max-width: 768px) {
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
        max-width: 600px;
    }
    
    .product-link img {
        max-width: 140px;
        max-height: 100px;
    }
    
    /* Center last item (7 items = last one alone) */
    .product-link:nth-child(7):last-child {
        grid-column: 1 / -1;
        justify-self: center;
    }
}

@media screen and (min-width: 769px) and (max-width: 1024px) {
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.8rem;
        max-width: 650px;
    }
    
    .product-link img {
        max-width: 180px;
        max-height: 120px;
    }
    
    /* Center last item if it's alone (7 items = last one alone) */
    .product-link:nth-child(7):last-child {
        grid-column: 1 / -1;
        justify-self: center;
    }
}

@media screen and (min-width: 1025px) {
    .product-grid {
        grid-template-columns: repeat(7, 1fr);
        gap: 3.5rem;
        max-width: 1600px;
    }
    
    .product-link img {
        max-width: 350px;
        max-height: 250px;
    }
}

@media screen and (max-width: 359px) {
    .logo {
        width: 170px;
    }
    
    h1 {
        font-size: 1.3rem;
    }
    
    .product-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        max-width: 280px;
    }
    
    .product-link {
        padding: 0.5rem;
        min-height: 75px;
    }
    
    .product-link img {
        max-width: 160px;
        max-height: 80px;
    }
}

@media screen and (max-height: 600px) and (orientation: landscape) {
    body {
        padding: 0.5rem;
    }
    
    .logo {
        width: 150px;
        margin-bottom: 1rem;
    }
    
    h1 {
        font-size: 1.5rem;
        margin-bottom: 0.3rem;
    }
    
    .subtitle {
        margin-bottom: 1rem;
    }
    
    .products {
        margin-bottom: 1rem;
    }
    
    .products h2 {
        margin-bottom: 0.3rem;
    }
    
    .products-description {
        margin-bottom: 1rem;
    }
    
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
        max-width: 500px;
    }
    
    .product-link img {
        max-width: 120px;
        max-height: 70px;
    }
    
    /* Center last item for 7 items in 3 columns */
    .product-link:nth-child(7):last-child {
        grid-column: 1 / -1;
        justify-self: center;
    }
}

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .product-link img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}