/*
Theme Name: LinksFinder
Theme URI: https://linksfinder.net
Description: A simple product showcase theme with ACF integration
Version: 1.0
Author: Your Name
Author URI: https://yoursite.com
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: linksfinder
*/

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

/* Header Styles */
.site-header {
    background-color: #ffffff;
    padding: 30px 20px 25px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-bottom: 5px;
}

.site-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 5px;
}

.site-description {
    font-size: 1.1rem;
    color: #666;
    font-weight: 400;
    margin-bottom: 0;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 5px 20px;
}

/* Product Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
    padding-bottom: 5px;
}

/* Product Card */
.product-card {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

.product-image-link {
    display: block;
    text-decoration: none;
}

.product-image {
    width: 100%;
    height: 280px;
    object-fit: contain;
    display: block;
    transition: opacity 0.3s ease;
    background: #f9f9f9;
}

.product-image-link:hover .product-image {
    opacity: 0.9;
}

.product-button {
    display: block;
    width: calc(100% - 40px);
    margin: 20px;
    padding: 15px 25px;
    background: linear-gradient(135deg, #4c7cf5 0%, #3d63c4 100%);
    color: white;
    text-align: center;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.product-button:hover {
    background: linear-gradient(135deg, #3d63c4 0%, #2e4d9e 100%);
    transform: scale(1.02);
}

/* Footer */
.site-footer {
    background-color: #ffffff;
    padding: 20px 20px;
    text-align: center;
    margin-top: 5px;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
}

.affiliate-disclaimer {
    font-size: 0.85rem;
    color: #666;
    line-height: 1.5;
    margin-bottom: 10px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.copyright {
    font-size: 0.9rem;
    color: #999;
    margin: 0;
}

/* Single Product Page Styles */
.product-detail-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 5px 20px 5px;
}

.product-detail-content {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 50px;
    background: #ffffff;
    border-radius: 16px;
    padding: 35px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    align-items: start;
}

.product-image-section {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f9f9f9;
    border-radius: 12px;
    padding: 20px;
    min-height: 350px;
    max-height: 350px;
}

.product-detail-image {
    width: 100%;
    height: 100%;
    max-height: 310px;
    object-fit: contain;
    display: block;
}

.product-info-section {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.product-title {
    font-size: 2rem;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.3;
    margin: 0 0 5px 0;
}

.product-links {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.view-on-amazon-label {
    font-size: 0.95rem;
    color: #333;
    font-weight: 600;
    margin: 0 0 5px 0;
}

.amazon-button {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: linear-gradient(135deg, #4c7cf5 0%, #3d63c4 100%);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(76, 124, 245, 0.3);
}

.amazon-button:hover {
    background: linear-gradient(135deg, #3d63c4 0%, #2e4d9e 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 124, 245, 0.4);
}

.country-code {
    font-weight: 700;
    font-size: 1rem;
    min-width: 26px;
}

.country-name {
    flex: 1;
    text-align: left;
    font-size: 0.95rem;
}

.external-icon {
    margin-left: auto;
}

/* Related Products Section */
.related-products-section {
    max-width: 1200px;
    margin: 5px auto 0;
    padding: 0 20px 5px;
}

.related-products-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 5px;
}

.related-products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
}

@media (max-width: 1100px) {
    .related-products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .related-products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Responsive Design */
@media (max-width: 968px) {
    .product-detail-content {
        grid-template-columns: 1fr;
        gap: 30px;
        padding: 25px;
    }
    
    .product-image-section {
        min-height: 300px;
        max-height: 300px;
    }
    
    .product-detail-image {
        max-height: 260px;
    }
    
    .product-title {
        font-size: 1.75rem;
    }
    
    .related-products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .site-title {
        font-size: 1.5rem;
        margin-bottom: 1px;
    }
    
    .site-description {
        font-size: 0.85rem;
        margin-bottom: 0;
        line-height: 1.3;
    }
    
    .site-header {
        padding: 6px 15px 4px;
        margin-bottom: 0;
    }
    
    .container {
        padding: 0 15px;
    }
    
    .site-main {
        padding-top: 2px;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        padding-bottom: 0;
        margin-top: 2px;
    }
    
    .product-image {
        height: 180px;
    }
    
    .product-detail-container {
        padding: 0 10px 0;
        margin-top: 2px;
    }
    
    .product-detail-content {
        padding: 12px;
        gap: 15px;
        margin-top: 2px;
    }
    
    .product-image-section {
        min-height: 220px;
        max-height: 220px;
        padding: 10px;
    }
    
    .product-detail-image {
        max-height: 200px;
    }
    
    .product-title {
        font-size: 1.3rem;
        margin: 0 0 5px 0;
    }
    
    .product-info-section {
        gap: 15px;
    }
    
    .product-links {
        gap: 8px;
    }
    
    .view-on-amazon-label {
        font-size: 0.85rem;
        margin: 0 0 3px 0;
    }
    
    .amazon-button {
        padding: 11px 14px;
        font-size: 0.85rem;
        gap: 8px;
    }
    
    .country-code {
        font-size: 0.9rem;
        min-width: 22px;
    }
    
    .country-name {
        font-size: 0.85rem;
    }
    
    .related-products-section {
        padding: 0 10px 0;
        margin-top: 5px;
    }
    
    .related-products-title {
        font-size: 1.3rem;
        margin-bottom: 5px;
    }
    
    .related-products-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .product-button {
        padding: 11px 14px;
        font-size: 0.85rem;
    }
    
    .product-card {
        margin-bottom: 0;
    }
    
    .site-footer {
        margin-top: 5px;
        padding: 15px 15px;
    }
    
    .affiliate-disclaimer {
        font-size: 0.75rem;
        margin-bottom: 8px;
    }
    
    .copyright {
        font-size: 0.8rem;
    }
}

/* Add this to your existing CSS or replace the mobile image styles */

@media (max-width: 768px) {
    .product-image-section {
        min-height: 350px;
        max-height: 350px;
        padding: 15px;
    }
    
    .product-detail-image {
        max-height: 320px;
    }
}

/* For even smaller screens if needed */
@media (max-width: 480px) {
    .product-image-section {
        min-height: 320px;
        max-height: 320px;
        padding: 12px;
    }
    
    .product-detail-image {
        max-height: 296px;
    }
}