/* Amazon Store Pro - Frontend Styles */
/* Version: 3.0.0 - Kit.co Style */

/* ===== MAIN KIT CONTAINER ===== */
.amz-pro-kit {
    max-width: 1200px;
    margin: 50px auto;
    padding: 0 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

/* ===== KIT HEADER ===== */
.amz-kit-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 50px 40px;
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
}

.amz-kit-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 100" fill="%23ffffff" opacity="0.1"><polygon points="1000,100 1000,0 0,100"/></svg>');
    background-size: cover;
}

.amz-kit-title {
    font-size: 3em;
    font-weight: 800;
    margin: 0 0 20px 0;
    color: white;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 2;
}

/* ===== COUNTRY SELECTOR ===== */
.amz-country-selector {
    display: inline-flex;
    align-items: center;
    gap: 15px;
    background: rgba(255, 255, 255, 0.15);
    padding: 15px 25px;
    border-radius: 50px;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    z-index: 2;
}

.amz-country-selector span {
    font-weight: 600;
    font-size: 16px;
    opacity: 0.9;
}

.amz-country-switcher {
    padding: 12px 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.9);
    font-size: 15px;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 200px;
}

.amz-country-switcher:hover {
    background: white;
    border-color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* ===== PRODUCTS GRID ===== */
.amz-products-grid {
    display: grid;
    gap: 30px;
    padding: 50px 40px;
    background: #f8f9fa;
}

/* Grid columns based on container attribute */
.amz-products-grid[data-columns="2"] { grid-template-columns: repeat(2, 1fr); }
.amz-products-grid[data-columns="3"] { grid-template-columns: repeat(3, 1fr); }
.amz-products-grid[data-columns="4"] { grid-template-columns: repeat(4, 1fr); }
.amz-products-grid[data-columns="5"] { grid-template-columns: repeat(5, 1fr); }

/* ===== PRODUCT CARD ===== */
.amz-product-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.08);
    border: 1px solid #e8e8e8;
    position: relative;
}

.amz-product-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
    border-color: #667eea;
}

.amz-product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.amz-product-card:hover::before {
    opacity: 1;
}

/* ===== PRODUCT IMAGE ===== */
.amz-product-image {
    position: relative;
    padding-bottom: 75%;
    overflow: hidden;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
}

.amz-product-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: all 0.4s ease;
    padding: 20px;
}

.amz-product-card:hover .amz-product-image img {
    transform: scale(1.1);
    filter: brightness(1.05);
}

/* ===== PRODUCT INFO ===== */
.amz-product-info {
    padding: 25px;
    text-align: center;
}

.amz-product-title {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.4;
    margin: 0 0 15px 0;
    color: #2d3748;
    min-height: 50px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.amz-product-description {
    color: #666;
    font-size: 14px;
    line-height: 1.6;
    margin: 0 0 20px 0;
    text-align: left;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ===== PRODUCT ACTIONS ===== */
.amz-product-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
}

/* Regular Buy Button */
.amz-buy-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #FFA41C, #FF8F00);
    color: #000 !important;
    padding: 14px 28px;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 14px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    min-width: 140px;
    box-shadow: 0 4px 15px rgba(255, 164, 28, 0.3);
}

.amz-buy-button:hover {
    background: linear-gradient(135deg, #FF8F00, #FF7B00);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 164, 28, 0.4);
    color: #000 !important;
}

/* CTA Image Button */
.amz-cta-button {
    display: inline-block;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: 3px solid transparent;
}

.amz-cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    border-color: #667eea;
}

.amz-cta-button img {
    display: block;
    width: 160px;
    height: auto;
    border-radius: 8px;
}

/* ===== LOADING STATES ===== */
.amz-product-image img[src=""],
.amz-product-image img:not([src]) {
    opacity: 0.5;
    background: #f8f9fa url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="50" height="50" viewBox="0 0 50 50" fill="%23666"><path d="M25 5A20 20 0 1 0 25 45A20 20 0 1 0 25 5Z" stroke="%23666" stroke-width="2" fill="none"/></svg>') center no-repeat;
}

/* ===== EMPTY STATES ===== */
.amz-pro-kit:empty::before {
    content: 'No products found in this kit.';
    display: block;
    text-align: center;
    padding: 60px 20px;
    color: #666;
    font-size: 18px;
    background: #f8f9fa;
    border-radius: 10px;
    margin: 20px;
}

/* ===== RESPONSIVE DESIGN ===== */

/* Large Desktop */
@media (max-width: 1440px) {
    .amz-pro-kit {
        margin: 40px auto;
    }
    
    .amz-products-grid[data-columns="5"] {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Desktop */
@media (max-width: 1200px) {
    .amz-products-grid[data-columns="4"],
    .amz-products-grid[data-columns="5"] {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .amz-kit-title {
        font-size: 2.5em;
    }
}

/* Tablet */
@media (max-width: 992px) {
    .amz-pro-kit {
        margin: 30px 20px;
        border-radius: 15px;
    }
    
    .amz-kit-header {
        padding: 40px 30px;
    }
    
    .amz-kit-title {
        font-size: 2em;
    }
    
    .amz-products-grid {
        padding: 40px 30px;
        gap: 25px;
    }
    
    .amz-products-grid[data-columns="3"],
    .amz-products-grid[data-columns="4"],
    .amz-products-grid[data-columns="5"] {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .amz-country-selector {
        flex-direction: column;
        gap: 12px;
        text-align: center;
        padding: 20px;
    }
    
    .amz-country-switcher {
        min-width: 180px;
    }
}

/* Large Mobile */
@media (max-width: 768px) {
    .amz-pro-kit {
        margin: 20px 15px;
        border-radius: 12px;
    }
    
    .amz-kit-header {
        padding: 30px 20px;
    }
    
    .amz-kit-title {
        font-size: 1.8em;
        margin-bottom: 15px;
    }
    
    .amz-products-grid {
        padding: 30px 20px;
        gap: 20px;
        grid-template-columns: 1fr !important;
    }
    
    .amz-product-info {
        padding: 20px;
    }
    
    .amz-product-title {
        font-size: 16px;
        min-height: auto;
    }
    
    .amz-product-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .amz-buy-button {
        width: 100%;
        max-width: 200px;
    }
    
    .amz-cta-button img {
        width: 140px;
    }
}

/* Mobile */
@media (max-width: 480px) {
    .amz-pro-kit {
        margin: 15px 10px;
        border-radius: 10px;
    }
    
    .amz-kit-header {
        padding: 25px 15px;
    }
    
    .amz-kit-title {
        font-size: 1.5em;
    }
    
    .amz-products-grid {
        padding: 25px 15px;
        gap: 15px;
    }
    
    .amz-product-info {
        padding: 15px;
    }
    
    .amz-product-title {
        font-size: 15px;
    }
    
    .amz-product-description {
        font-size: 13px;
        -webkit-line-clamp: 3;
    }
    
    .amz-buy-button {
        padding: 12px 20px;
        font-size: 13px;
    }
    
    .amz-cta-button img {
        width: 120px;
    }
    
    .amz-country-selector {
        padding: 15px;
    }
    
    .amz-country-switcher {
        padding: 10px 15px;
        font-size: 14px;
        min-width: 160px;
    }
}

/* ===== DARK MODE SUPPORT ===== */
@media (prefers-color-scheme: dark) {
    .amz-pro-kit {
        background: #1a1a1a;
        color: #ffffff;
    }
    
    .amz-products-grid {
        background: #2d2d2d;
    }
    
    .amz-product-card {
        background: #2d2d2d;
        border-color: #404040;
    }
    
    .amz-product-title {
        color: #ffffff;
    }
    
    .amz-product-description {
        color: #cccccc;
    }
    
    .amz-product-image {
        background: linear-gradient(135deg, #2d2d2d, #404040);
    }
}

/* ===== ANIMATIONS ===== */
@keyframes amzFadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.amz-product-card {
    animation: amzFadeInUp 0.6s ease-out;
}

.amz-product-card:nth-child(odd) {
    animation-delay: 0.1s;
}

.amz-product-card:nth-child(even) {
    animation-delay: 0.2s;
}

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
    .amz-product-card,
    .amz-product-image img,
    .amz-buy-button,
    .amz-cta-button,
    .amz-country-switcher {
        transition: none;
        animation: none;
    }
}

/* Focus styles for keyboard navigation */
.amz-buy-button:focus,
.amz-cta-button:focus,
.amz-country-switcher:focus {
    outline: 3px solid #667eea;
    outline-offset: 2px;
}

/* ===== PRINT STYLES ===== */
@media print {
    .amz-country-selector,
    .amz-product-actions {
        display: none;
    }
    
    .amz-pro-kit {
        box-shadow: none;
        margin: 0;
    }
    
    .amz-product-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }
}

/* ===== CUSTOM SCROLLBAR ===== */
.amz-products-grid::-webkit-scrollbar {
    width: 8px;
}

.amz-products-grid::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.amz-products-grid::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 10px;
}

.amz-products-grid::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #764ba2, #667eea);
}