/*
Theme Name: E-commerce Modern (Amazon Style)
Theme URI: https://example.com/
Author: Custom Development
Author URI: https://example.com/
Description: A modern, Amazon-inspired WooCommerce theme with professional functionality and rich animations. Built on Aurum foundation with enhanced Amazon-style design elements.
Version: 1.0
Requires at least: 5.0
Tested up to: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: ecommodern
Tags: e-commerce, woocommerce, responsive-layout, custom-header, custom-menu, featured-images

This theme is designed to work with the WooCommerce plugin with Amazon-inspired design.
*/

/* === AMAZON-STYLE CSS VARIABLES === */
:root {
    /* Amazon Color Palette */
    --amazon-dark-blue: #232f3e;
    --amazon-light-blue: #37475a;
    --amazon-yellow: #febd69;
    --amazon-orange: #ff9900;
    
    /* Text Colors */
    --text-color-dark: #0f1111;
    --text-color-light: #ffffff;
    --text-color-muted: #565959;
    
    /* UI Colors */
    --link-color: #007185;
    --border-color: #d5d9d9;
    --background-light: #f7f8f8;
    --background-white: #ffffff;
    
    /* Interactive Elements */
    --button-primary-bg: #ff9900;
    --button-primary-hover: #e88e00;
    --button-secondary-bg: #ffd814;
    --button-secondary-hover: #f7ca00;
    
    /* Layout */
    --border-radius: 4px;
    --box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    --container-max-width: 1200px;
    
    /* Typography */
    --font-family-primary: 'Amazon Ember', Arial, sans-serif;
    --font-size-base: 14px;
    --line-height-base: 1.5;
}

/* === GLOBAL RESET & BASE STYLES === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 14px;
    line-height: 1.5;
}

body {
    font-family: var(--font-family-primary);
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    color: var(--text-color-dark);
    background-color: var(--background-light);
    margin: 0;
    padding: 0;
}

/* Critical Layout Fixes */
.site {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.site-content {
    flex: 1;
}

/* Container Reset */
.container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 15px;
    width: 100%;
}

/* Clear WordPress defaults */
img {
    height: auto;
    max-width: 100%;
}

/* List reset */
ul, ol {
    margin: 0;
    padding: 0;
}

li {
    list-style: none;
}

/* Link reset */
a {
    color: var(--link-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--amazon-orange);
    text-decoration: underline;
}

a:focus {
    outline: 2px solid var(--amazon-orange);
    outline-offset: 2px;
}

/* Form element resets */
input, select, textarea, button {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
}

button {
    cursor: pointer;
    border: none;
    background: none;
}

/* WordPress content fixes */
.entry-content {
    word-wrap: break-word;
}

.wp-block-image {
    margin: 0;
}

/* Clear floats */
.clearfix::after {
    content: "";
    display: table;
    clear: both;
}

.container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 15px;
}

a {
    color: var(--link-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--amazon-orange);
    text-decoration: underline;
}

/* === UTILITY CLASSES === */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

.btn {
    display: inline-block;
    padding: 8px 16px;
    border: 1px solid transparent;
    border-radius: var(--border-radius);
    font-weight: normal;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: var(--font-size-base);
}

.btn-primary {
    background-color: var(--button-primary-bg);
    border-color: #cc7a00;
    color: var(--text-color-dark);
}

.btn-primary:hover {
    background-color: var(--button-primary-hover);
    color: var(--text-color-dark);
    text-decoration: none;
}

.btn-secondary {
    background-color: var(--button-secondary-bg);
    border-color: #f0c14b;
    color: var(--text-color-dark);
}

.btn-secondary:hover {
    background-color: var(--button-secondary-hover);
    color: var(--text-color-dark);
    text-decoration: none;
}

/* === ANIMATIONS === */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

.slide-in {
    animation: slideIn 0.4s ease-out;
}

/* Amazon-style component styles will be loaded separately via functions.php */

/* === CRITICAL OVERRIDES FOR AURUM THEME === */
/* Ensure Amazon styles take precedence */

/* Override Aurum header styles */
.site-header,
.amazon-header {
    background: var(--amazon-dark-blue) !important;
    border: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Override container styles */
.container-fluid,
.row {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
}

/* Override bootstrap grid conflicts */
.col-sm-12,
.col-md-12,
.col-lg-12 {
    padding: 0 !important;
    margin: 0 !important;
}

/* Ensure proper spacing for homepage sections */
.homepage-main {
    margin: 0 !important;
    padding: 0 !important;
    width: 100%;
}

.homepage-main .container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 15px;
}

/* Fix any text color overrides */
.homepage-main h1,
.homepage-main h2,
.homepage-main h3,
.homepage-main h4,
.homepage-main h5,
.homepage-main h6 {
    color: var(--text-color-dark) !important;
}

/* Ensure links work properly */
.homepage-main a {
    color: var(--link-color) !important;
    text-decoration: none !important;
}

.homepage-main a:hover {
    color: var(--amazon-orange) !important;
}

/* Override any conflicting margin/padding */
.product-section {
    margin: 0 !important;
    clear: both;
}

/* Fix grid layouts */
.category-grid,
.products-grid {
    display: grid !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Ensure hero section displays properly */
.hero-section {
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
}

/* Fix any Bootstrap conflicts */
* {
    -webkit-box-sizing: border-box !important;
    -moz-box-sizing: border-box !important;
    box-sizing: border-box !important;
}

/* Override theme defaults */
body.home {
    background: var(--background-light) !important;
}

/* Ensure proper font loading */
body,
input,
textarea,
select,
button {
    font-family: 'Amazon Ember', Arial, sans-serif !important;
}

/* Fix header positioning */
.site-header {
    position: relative !important;
    z-index: 1000 !important;
}

/* Ensure content area is clear */
#content,
.site-content {
    clear: both !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
}

/* === HOMEPAGE SPECIFIC STYLES === */

/* Hero Section */
.hero-section {
    position: relative;
    min-height: 400px;
    background: linear-gradient(135deg, #232f3e 0%, #37475a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-align: center;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('https://m.media-amazon.com/images/I/61lwJy4B8PL._SX3000_.jpg') no-repeat center center/cover;
    opacity: 0.3;
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 600px;
    padding: 20px;
}

.hero-title {
    font-size: 48px;
    font-weight: bold;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.hero-subtitle {
    font-size: 18px;
    margin-bottom: 30px;
    opacity: 0.9;
    line-height: 1.6;
}

.hero-cta {
    display: inline-block;
    background: var(--amazon-orange);
    color: white;
    padding: 15px 30px;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: bold;
    font-size: 18px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 153, 0, 0.3);
}

.hero-cta:hover {
    background: #e88900;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 153, 0, 0.4);
    color: white;
    text-decoration: none;
}

/* Product Sections */
.product-section {
    padding: 40px 0;
    background: #f8f9fa;
}

.product-section:nth-child(even) {
    background: white;
}

.product-section-header {
    text-align: center;
    margin-bottom: 40px;
}

.product-section-header h2 {
    font-size: 32px;
    color: var(--text-color-dark);
    margin-bottom: 10px;
    font-weight: bold;
}

.product-section-subtitle {
    font-size: 16px;
    color: #666;
    margin: 0;
}

.product-section-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Homepage Category Cards */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 20px;
}

.category-card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid #e0e0e0;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border-color: var(--amazon-orange);
}

.category-card-image {
    height: 200px;
    overflow: hidden;
    position: relative;
}

.category-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.category-card:hover .category-card-image img {
    transform: scale(1.05);
}

.category-card-content {
    padding: 20px;
}

.category-card h3 {
    font-size: 20px;
    margin-bottom: 10px;
    color: var(--text-color-dark);
    font-weight: bold;
}

.category-description {
    color: #666;
    font-size: 14px;
    margin-bottom: 15px;
    line-height: 1.5;
}

.category-products {
    background: #f8f9fa;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 15px;
}

.category-products span {
    color: #555;
    font-size: 12px;
    line-height: 1.4;
}

.shop-now-link {
    display: inline-block;
    background: var(--amazon-yellow);
    color: var(--text-color-dark);
    padding: 10px 20px;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: bold;
    font-size: 14px;
    transition: all 0.3s ease;
    border: 1px solid #ddd;
}

.shop-now-link:hover {
    background: var(--button-secondary-hover);
    color: var(--text-color-dark);
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* Homepage Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

/* Enhanced Product Cards for Homepage */
.homepage-main .product-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.homepage-main .product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
    border-color: var(--amazon-orange);
}

.homepage-main .product-card a {
    text-decoration: none;
    color: inherit;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.homepage-main .product-card a:hover {
    text-decoration: none;
    color: inherit;
}

.homepage-main .product-card-image {
    height: 200px;
    position: relative;
    overflow: hidden;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
}

.homepage-main .product-card-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.homepage-main .product-card:hover .product-card-image img {
    transform: scale(1.05);
}

.homepage-main .product-card-info {
    padding: 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.homepage-main .product-title {
    font-size: 14px;
    line-height: 1.4;
    margin-bottom: 10px;
    color: var(--link-color);
    height: auto;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    font-weight: normal;
}

.homepage-main .product-title:hover {
    color: var(--amazon-orange);
}

.homepage-main .product-rating {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 10px;
}

.homepage-main .product-rating .stars {
    color: #ffa41c;
    font-size: 14px;
}

.homepage-main .product-rating .rating-count {
    color: var(--link-color);
    font-size: 12px;
    text-decoration: none;
}

.homepage-main .product-rating .rating-count:hover {
    color: var(--amazon-orange);
    text-decoration: underline;
}

.homepage-main .product-price {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.homepage-main .product-price .price-current {
    font-size: 16px;
    font-weight: bold;
    color: #B12704;
}

.homepage-main .product-price .price-original {
    font-size: 12px;
    color: #999;
    text-decoration: line-through;
}

.homepage-main .product-price .discount {
    background: #CC0C39;
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: bold;
    align-self: flex-start;
}

/* Lightning Deals Specific Styling */
.deal-card {
    border: 2px solid #cc0c39 !important;
    background: linear-gradient(145deg, #fff 0%, #fff9f9 100%) !important;
}

.deal-card:hover {
    border-color: #b50000 !important;
    transform: translateY(-5px);
}

.deal-timer {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #cc0c39;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: bold;
    z-index: 5;
}

/* Responsive Design for Homepage */
@media (max-width: 768px) {
    .hero-title {
        font-size: 32px;
    }
    
    .hero-subtitle {
        font-size: 16px;
    }
    
    .hero-cta {
        padding: 12px 24px;
        font-size: 16px;
    }
    
    .product-section {
        padding: 30px 0;
    }
    
    .product-section-header h2 {
        font-size: 24px;
    }
    
    .category-grid,
    .products-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 15px;
    }
    
    .product-section-content {
        padding: 0 15px;
    }
}

@media (max-width: 480px) {
    .hero-section {
        min-height: 300px;
    }
    
    .hero-title {
        font-size: 24px;
    }
    
    .category-grid,
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    .homepage-main .product-card-image {
        height: 180px;
    }
}