/* Base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
    font-size: 16px;
}

.container {
    width: 95%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 10px;
}

/* Header */
header {
    background: linear-gradient(135deg, #232f3e, #146eb4);
    color: white;
    padding: 1rem 0;
    text-align: center;
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 0.3rem;
}

.logo {
    width: 40px;
    height: 40px;
}

header h1 {
    font-size: 1.5rem;
    margin: 0;
    font-weight: 700;
}

header p {
    font-size: 0.9rem;
    opacity: 0.9;
    font-weight: 300;
    margin-top: 0.2rem;
}

/* Navigation */
.main-nav {
    background-color: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.main-nav ul {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    flex-wrap: wrap;
}

.main-nav li {
    margin: 0;
    flex: 1;
}

.main-nav a {
    display: block;
    padding: 10px 3px;
    text-decoration: none;
    color: #232f3e;
    font-weight: 500;
    font-size: 0.85rem;
    text-align: center;
    transition: all 0.2s ease;
}

.main-nav a:hover,
.main-nav a.active {
    background-color: #232f3e;
    color: white;
}

/* Hero section */
.hero {
    background-color: white;
    padding: 1.5rem 0;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.hero h2 {
    font-size: 1.3rem;
    margin-bottom: 0.8rem;
    color: #232f3e;
    font-weight: 700;
}

.hero p {
    font-size: 0.9rem;
    margin: 0 auto 1rem;
    color: #555;
    font-weight: 300;
}

/* Search bar */
.search-container {
    display: flex;
    max-width: 100%;
    margin: 0 auto 1rem;
    gap: 8px;
}

#search-input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
}

#search-button {
    padding: 10px 15px;
    background: #ff9900;
    color: #232f3e;
    border: none;
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
    font-size: 0.9rem;
}

#search-button:hover {
    background: #e68a00;
}

.cta-button {
    display: inline-block;
    background: #ff9900;
    color: #232f3e;
    padding: 8px 15px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    border: 2px solid #ff9900;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.cta-button:hover {
    background: transparent;
    color: #ff9900;
    transform: translateY(-1px);
}

/* Products section */
.products {
    padding: 1.5rem 0;
    background-color: #f8f9fa;
}

.products h2 {
    text-align: center;
    font-size: 1.4rem;
    margin-bottom: 1rem;
    color: #232f3e;
    font-weight: 700;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 1.5rem;
}

.product-card {
    background: white;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.image-container {
    width: 100%;
    height: 150px;
    position: relative;
}

.product-image,
.main-image {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.image-placeholder {
    width: 100%;
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f0f2f5;
    font-size: 2.5rem;
}

/* Image gallery styles */
.image-gallery {
    width: 100%;
    height: 150px;
}

.main-image-container {
    width: 100%;
    height: 120px;
    overflow: hidden;
}

.main-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumbnail-container {
    display: flex;
    height: 30px;
    gap: 3px;
    padding: 3px;
    background: rgba(0,0,0,0.7);
}

.thumbnail {
    width: 25px;
    height: 24px;
    object-fit: cover;
    cursor: pointer;
    border: 1px solid transparent;
    opacity: 0.7;
    transition: all 0.2s ease;
}

.thumbnail:hover {
    opacity: 1;
    transform: scale(1.1);
}

.thumbnail.active {
    border-color: #ff9900;
    opacity: 1;
}

.product-info {
    padding: 10px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-card h3 {
    font-size: 0.9rem;
    color: #232f3e;
    font-weight: 500;
    margin-bottom: 5px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card p {
    color: #666;
    font-size: 0.8rem;
    font-weight: 300;
    margin-bottom: 8px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex-grow: 1;
}

.product-card .full-description {
    display: none;
}

.read-more {
    background: none;
    border: none;
    color: #146eb4;
    font-size: 0.75rem;
    cursor: pointer;
    text-align: left;
    padding: 0;
    margin: 3px 0 5px;
    font-weight: 500;
    display: none;
}

.read-more:hover {
    text-decoration: underline;
}

.price-container {
    margin-bottom: 8px;
}

.price {
    font-weight: 700;
    color: #232f3e;
    font-size: 1rem;
    display: inline-block;
    margin-right: 3px;
}

.price-disclaimer {
    font-size: 0.6rem;
    color: #888;
    font-style: italic;
    display: inline-block;
}

.affiliate-link {
    display: block;
    background: #232f3e;
    color: white;
    text-align: center;
    padding: 8px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.85rem;
    transition: background 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border: none;
    cursor: pointer;
    margin-top: auto;
}

.affiliate-link:hover {
    background: #146eb4;
    transform: translateY(-1px);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 15px;
}

.pagination button {
    padding: 6px 12px;
    background: #232f3e;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s ease;
    font-size: 0.85rem;
}

.pagination button:hover:not(:disabled) {
    background: #146eb4;
}

.pagination button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

#page-info {
    font-weight: 500;
    color: #232f3e;
    font-size: 0.9rem;
}

/* About page */
.about-hero {
    background: linear-gradient(135deg, #232f3e, #146eb4);
    color: white;
    padding: 1.5rem 0;
    text-align: center;
}

.about-hero h2 {
    font-size: 1.5rem;
    margin-bottom: 0.8rem;
    font-weight: 700;
}

.about-hero p {
    font-size: 1rem;
    max-width: 700px;
    margin: 0 auto;
    opacity: 0.9;
    font-weight: 300;
}

.about-content {
    padding: 1.5rem 0;
}

.about-content .container {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.about-text {
    flex: 1;
    min-width: 300px;
}

.about-text h3 {
    color: #232f3e;
    margin: 1rem 0 0.4rem;
    font-size: 1.1rem;
    font-weight: 500;
}

.about-text p {
    margin-bottom: 0.8rem;
    color: #555;
    font-size: 0.9rem;
    font-weight: 300;
}

.about-text a {
    color: #146eb4;
    text-decoration: none;
    font-weight: 500;
}

.about-text a:hover {
    text-decoration: underline;
}

.about-image {
    flex: 1;
    min-width: 300px;
    text-align: center;
    display: none; /* Hidden for performance */
}

.about-image img {
    max-width: 100%;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* Legal pages */
.legal-content {
    padding: 1.5rem 0;
    background-color: white;
}

.legal-content h2 {
    color: #232f3e;
    margin-bottom: 1rem;
    text-align: center;
    font-size: 1.4rem;
    font-weight: 700;
}

.legal-content h3 {
    color: #232f3e;
    margin: 1rem 0 0.4rem;
    font-size: 1.1rem;
    font-weight: 500;
}

.legal-content p {
    margin-bottom: 0.8rem;
    color: #555;
    font-size: 0.9rem;
    font-weight: 300;
}

.legal-content ul {
    margin-left: 15px;
    margin-bottom: 0.8rem;
}

.legal-content li {
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
    font-weight: 300;
}

.legal-content a {
    color: #146eb4;
    text-decoration: none;
    font-weight: 500;
}

.legal-content a:hover {
    text-decoration: underline;
}

/* Footer */
footer {
    background: #232f3e;
    color: white;
    text-align: center;
    padding: 1.2rem 0;
    font-size: 0.85rem;
}

footer p {
    margin-bottom: 6px;
    font-weight: 300;
}

footer a {
    color: #ff9900;
    text-decoration: none;
    font-weight: 500;
}

footer a:hover {
    text-decoration: underline;
}

/* Responsive design */
@media (min-width: 1200px) {
    .product-grid {
        grid-template-columns: repeat(6, 1fr);
    }
    
    .container {
        width: 90%;
        max-width: 1200px;
        padding: 0 15px;
    }
    
    .product-card h3 {
        font-size: 0.95rem;
    }
    
    .product-card p {
        font-size: 0.85rem;
    }
    
    .price {
        font-size: 1.1rem;
    }
    
    .affiliate-link {
        font-size: 0.9rem;
        padding: 10px;
    }
    
    .image-container, .product-image, .main-image {
        height: 180px;
    }
    
    .image-gallery {
        height: 180px;
    }
    
    .main-image-container {
        height: 140px;
    }
    
    .thumbnail-container {
        height: 40px;
        padding: 5px;
    }
    
    .thumbnail {
        width: 30px;
        height: 30px;
    }
}

@media (max-width: 768px) {
    body {
        font-size: 15px;
    }
    
    header {
        padding: 0.8rem 0;
    }
    
    .logo-container {
        flex-direction: column;
        gap: 3px;
    }
    
    .logo {
        width: 35px;
        height: 35px;
    }
    
    header h1 {
        font-size: 1.3rem;
    }
    
    .hero {
        padding: 1.2rem 0;
    }
    
    .hero h2 {
        font-size: 1.1rem;
    }
    
    .search-container {
        flex-direction: column;
    }
    
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .main-nav ul {
        flex-direction: row;
    }
    
    .main-nav li {
        flex: 1;
    }
    
    .main-nav a {
        padding: 8px 2px;
        font-size: 0.75rem;
    }
    
    .about-content .container {
        flex-direction: column;
    }
    
    .about-hero {
        padding: 1.2rem 0;
    }
    
    .about-hero h2 {
        font-size: 1.3rem;
    }
    
    .products, .how-it-works, .about-content, .legal-content {
        padding: 1.2rem 0;
    }
    
    .pagination {
        flex-direction: row;
        gap: 8px;
    }
    
    .thumbnail {
        width: 20px;
        height: 20px;
    }
    
    .image-container, .product-image, .main-image {
        height: 140px;
    }
    
    .image-gallery {
        height: 140px;
    }
    
    .main-image-container {
        height: 110px;
    }
    
    .thumbnail-container {
        height: 30px;
        padding: 3px;
    }
}

@media (max-width: 480px) {
    .container {
        width: 95%;
        padding: 0 8px;
    }
    
    .main-nav a {
        font-size: 0.7rem;
        padding: 6px 1px;
    }
    
    .product-card h3 {
        font-size: 0.85rem;
    }
    
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .image-container, .product-image, .main-image {
        height: 130px;
    }
    
    .image-gallery {
        height: 130px;
    }
    
    .main-image-container {
        height: 100px;
    }
    
    .thumbnail-container {
        height: 30px;
        padding: 2px;
    }
    
    .thumbnail {
        width: 18px;
        height: 18px;
    }
    
    .product-info {
        padding: 8px;
    }
    
    .price {
        font-size: 0.9rem;
    }
    
    .affiliate-link {
        font-size: 0.8rem;
        padding: 6px;
    }
}