/* ========================================
   CSS Variables & Root Styles
======================================== */
:root {
    --primary-color: #e74c3c;
    --secondary-color: #2c3e50;
    --accent-color: #f39c12;
    --success-color: #27ae60;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --info-color: #3498db;
    --dark-color: #2c3e50;
    --light-color: #ecf0f1;
    --white-color: #ffffff;
    --text-color: #333333;
    --text-light: #7f8c8d;
    --border-color: #dfe6e9;
    --shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 5px 30px rgba(0, 0, 0, 0.15);
    --transition: all 0.3s ease;
    --font-primary: 'Poppins', sans-serif;
    --border-radius: 8px;
}

/* ========================================
   Reset & Base Styles
======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-color);
    background-color: #f8f9fa;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

button {
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
    transition: var(--transition);
}

input, textarea, select {
    font-family: inherit;
    font-size: inherit;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ========================================
   Top Bar
======================================== */
.top-bar {
    background: var(--dark-color);
    color: var(--white-color);
    padding: 10px 0;
    font-size: 14px;
}

.top-bar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.top-bar-left span,
.top-bar-right a {
    margin-right: 20px;
}

.top-bar-right a {
    color: var(--white-color);
}

.top-bar-right a:hover {
    color: var(--primary-color);
}

.top-bar i {
    margin-right: 5px;
}

/* ========================================
   Main Header
======================================== */
.main-header {
    background: var(--white-color);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 0;
    gap: 30px;
}

/* Logo */
.logo-text {
    font-size: 28px;
    font-weight: 700;
    color: var(--dark-color);
}

.logo-text span {
    color: var(--primary-color);
}

/* Search Bar */
.search-bar {
    flex: 1;
    max-width: 500px;
    position: relative;
}

.search-bar form {
    display: flex;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: var(--transition);
}

.search-bar form:focus-within {
    border-color: var(--primary-color);
}

.search-bar input {
    flex: 1;
    padding: 12px 15px;
    border: none;
    outline: none;
}

.search-bar button {
    padding: 12px 20px;
    background: var(--primary-color);
    color: var(--white-color);
}

.search-bar button:hover {
    background: #c0392b;
}

.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white-color);
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    max-height: 300px;
    overflow-y: auto;
    display: none;
    z-index: 100;
    box-shadow: var(--shadow);
}

.search-suggestions.active {
    display: block;
}

.suggestion-item {
    padding: 12px 15px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.suggestion-item:hover {
    background: var(--light-color);
}

.suggestion-item img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-action-btn {
    position: relative;
    font-size: 22px;
    color: var(--dark-color);
    padding: 8px;
}

.header-action-btn:hover {
    color: var(--primary-color);
}

.header-action-btn .badge {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--primary-color);
    color: var(--white-color);
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 50%;
    min-width: 18px;
    text-align: center;
}

/* User Menu */
.user-menu {
    position: relative;
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--white-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    min-width: 200px;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: var(--transition);
}

.user-menu:hover .user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown a {
    display: block;
    padding: 12px 20px;
    color: var(--text-color);
    border-bottom: 1px solid var(--border-color);
}

.user-dropdown a:last-child {
    border-bottom: none;
}

.user-dropdown a:hover {
    background: var(--light-color);
    color: var(--primary-color);
}

.user-dropdown i {
    margin-right: 10px;
    width: 20px;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    font-size: 24px;
    color: var(--dark-color);
}

/* ========================================
   Navigation
======================================== */
.main-nav {
    background: var(--secondary-color);
}

.nav-menu {
    display: flex;
    justify-content: center;
    align-items: center;
}

.nav-menu > li {
    position: relative;
}

.nav-menu > li > a {
    display: block;
    padding: 15px 20px;
    color: var(--white-color);
    font-weight: 500;
    transition: var(--transition);
}

.nav-menu > li > a:hover,
.nav-menu > li > a.active {
    background: var(--primary-color);
}

/* Dropdown */
.has-dropdown {
    position: relative;
}

.dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--white-color);
    min-width: 200px;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: var(--transition);
}

.has-dropdown:hover .dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown li a {
    display: block;
    padding: 12px 20px;
    color: var(--text-color);
    border-bottom: 1px solid var(--border-color);
}

.dropdown li:last-child a {
    border-bottom: none;
}

.dropdown li a:hover {
    background: var(--light-color);
    color: var(--primary-color);
    padding-left: 25px;
}

/* ========================================
   Hero Section
======================================== */
.hero-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 100px 0;
    color: var(--white-color);
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><circle cx="50" cy="50" r="2" fill="white" opacity="0.1"/></svg>');
    animation: heroPattern 20s linear infinite;
}

@keyframes heroPattern {
    0% { transform: translateY(0); }
    100% { transform: translateY(100px); }
}

.hero-content {
    text-align: center;
    position: relative;
    z-index: 1;
}

.hero-title {
    font-size: 56px;
    font-weight: 700;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.hero-subtitle {
    font-size: 24px;
    margin-bottom: 30px;
    opacity: 0.9;
}

/* ========================================
   Features Section
======================================== */
.features-section {
    padding: 60px 0;
    background: var(--white-color);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.feature-card {
    text-align: center;
    padding: 30px;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
}

.feature-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    color: var(--white-color);
}

.feature-card h3 {
    font-size: 20px;
    margin-bottom: 10px;
    color: var(--dark-color);
}

.feature-card p {
    color: var(--text-light);
    font-size: 14px;
}

/* ========================================
   Section Headers
======================================== */
.section-header {
    text-align: center;
    margin-bottom: 50px;
}

.section-title {
    font-size: 36px;
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 10px;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--primary-color);
}

.section-subtitle {
    color: var(--text-light);
    font-size: 16px;
}

/* ========================================
   Categories Section
======================================== */
.categories-section {
    padding: 60px 0;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.category-card {
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    background: var(--white-color);
}

.category-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
}

.category-image {
    height: 200px;
    overflow: hidden;
}

.category-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.category-card:hover .category-image img {
    transform: scale(1.1);
}

.category-card h3 {
    text-align: center;
    padding: 20px;
    font-size: 18px;
    color: var(--dark-color);
}

/* ========================================
   Products Section
======================================== */
.products-section {
    padding: 60px 0;
    background: var(--white-color);
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
}

.product-card {
    background: var(--white-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.product-image {
    position: relative;
    height: 280px;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.product-card:hover .product-image img {
    transform: scale(1.1);
}

.product-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--primary-color);
    color: var(--white-color);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.product-actions {
    position: absolute;
    top: 15px;
    left: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    opacity: 0;
    transform: translateX(-20px);
    transition: var(--transition);
}

.product-card:hover .product-actions {
    opacity: 1;
    transform: translateX(0);
}

.btn-icon {
    width: 40px;
    height: 40px;
    background: var(--white-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--dark-color);
    box-shadow: var(--shadow);
}

.btn-icon:hover {
    background: var(--primary-color);
    color: var(--white-color);
}

.product-info {
    padding: 20px;
}

.product-title a {
    font-size: 16px;
    font-weight: 600;
    color: var(--dark-color);
    display: block;
    margin-bottom: 10px;
}

.product-title a:hover {
    color: var(--primary-color);
}

.product-price {
    margin-bottom: 15px;
}

.price-new {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary-color);
    margin-right: 10px;
}

.price-old {
    font-size: 16px;
    color: var(--text-light);
    text-decoration: line-through;
}

/* ========================================
   Buttons
======================================== */
.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: var(--border-radius);
    font-weight: 600;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
}
/* Out of Stock Button */
.btn-outline-secondary {
    background: transparent;
    color: #6c757d;
    border: 2px solid #6c757d;
    cursor: not-allowed;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-outline-secondary:hover {
    background: transparent;
    color: #6c757d;
    border-color: #6c757d;
    transform: none;
    box-shadow: none;
}

.btn-outline-secondary:disabled {
    opacity: 0.7;
}

.btn-outline-secondary i {
    font-size: 16px;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--white-color);
}

.btn-primary:hover {
    background: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(231, 76, 60, 0.3);
}

.btn-outline-primary {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    color: var(--white-color);
}

.btn-block {
    width: 100%;
}

/* ========================================
   Newsletter Section
======================================== */
.newsletter-section {
    padding: 60px 0;
    background: var(--dark-color);
    color: var(--white-color);
}

.newsletter-content {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.newsletter-content h2 {
    font-size: 32px;
    margin-bottom: 10px;
}

.newsletter-content p {
    margin-bottom: 30px;
    opacity: 0.9;
}

.newsletter-form {
    display: flex;
    max-width: 500px;
    margin: 0 auto;
    gap: 10px;
}

.newsletter-form input {
    flex: 1;
    padding: 15px;
    border: none;
    border-radius: var(--border-radius);
    outline: none;
}

.newsletter-form button {
    padding: 15px 30px;
}

/* ========================================
   Footer
======================================== */
.main-footer {
    background: var(--dark-color);
    color: var(--white-color);
}

.footer-top {
    padding: 60px 0 30px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
}

.footer-title {
    font-size: 20px;
    margin-bottom: 20px;
    font-weight: 600;
    position: relative;
    padding-bottom: 10px;
}

.footer-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 2px;
    background: var(--primary-color);
}

.footer-text {
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 20px;
    line-height: 1.8;
}

.social-links {
    display: flex;
    gap: 10px;
}

.social-links a {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white-color);
}

.social-links a:hover {
    background: var(--primary-color);
    transform: translateY(-3px);
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.7);
    display: inline-block;
}

.footer-links a:hover {
    color: var(--primary-color);
    padding-left: 5px;
}

.footer-contact li {
    display: flex;
    align-items: flex-start;
    margin-bottom: 15px;
    color: rgba(255, 255, 255, 0.7);
}

.footer-contact i {
    margin-right: 15px;
    margin-top: 5px;
    color: var(--primary-color);
    font-size: 18px;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 20px 0;
}

.footer-bottom-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.copyright {
    color: rgba(255, 255, 255, 0.7);
}

.payment-methods {
    display: flex;
    align-items: center;
    gap: 15px;
    color: rgba(255, 255, 255, 0.7);
}

.payment-methods i {
    font-size: 24px;
}

/* ========================================
   Back to Top Button
======================================== */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    color: var(--white-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 999;
    box-shadow: var(--shadow-lg);
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: #c0392b;
    transform: translateY(-5px);
}

/* ========================================
   Toast Notification
======================================== */
.toast {
    position: fixed;
    top: 100px;
    right: 30px;
    background: var(--white-color);
    padding: 15px 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    min-width: 300px;
    opacity: 0;
    visibility: hidden;
    transform: translateX(400px);
    transition: var(--transition);
    z-index: 9999;
}

.toast.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

.toast.success {
    border-left: 4px solid var(--success-color);
}

.toast.error {
    border-left: 4px solid var(--danger-color);
}

.toast.warning {
    border-left: 4px solid var(--warning-color);
}

.toast.info {
    border-left: 4px solid var(--info-color);
}

/* ========================================
   Utility Classes
======================================== */
.text-center {
    text-align: center;
}

.mt-4 {
    margin-top: 2rem;
}

.mb-4 {
    margin-bottom: 2rem;
}

.main-content {
    min-height: calc(100vh - 400px);
}