/* ========================================
   ECOMMERCE CUSTOM STYLES
   File: ecommerce-styles.css
   Purpose: Complete styling for WordPress WooCommerce site
   ======================================== */

/* ========================================
   GENERAL STYLES & RESET
   ======================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ========================================
   CUSTOM PRODUCT CARD DESIGN
   ======================================== */

.custom-product-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin: 15px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

.custom-product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

.custom-product-card img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 15px;
    transition: transform 0.3s ease;
}

.custom-product-card:hover img {
    transform: scale(1.05);
}

.custom-product-card h3 {
    font-size: 1.3em;
    margin-bottom: 10px;
    color: #2c3e50;
    font-weight: 600;
}

.custom-product-card .product-description {
    font-size: 0.9em;
    color: #7f8c8d;
    margin-bottom: 15px;
    line-height: 1.4;
}

.custom-product-card .price {
    font-size: 1.5em;
    color: #e74c3c;
    font-weight: bold;
    margin-bottom: 15px;
    display: block;
}

.custom-product-card .old-price {
    text-decoration: line-through;
    color: #7f8c8d;
    font-size: 1.2em;
    margin-right: 10px;
}

.custom-product-card .badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #e74c3c;
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: bold;
    text-transform: uppercase;
    z-index: 5;
}

.custom-product-card .badge.new {
    background: #27ae60;
}

.custom-product-card .badge.featured {
    background: #f39c12;
}

/* ========================================
   SHOPPING CART BUTTON
   ======================================== */

.add-to-cart-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 1em;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.add-to-cart-btn:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.add-to-cart-btn:active {
    transform: scale(0.98);
}

.add-to-cart-btn:disabled {
    background: #95a5a6;
    cursor: not-allowed;
    transform: none;
}

/* ========================================
   MINI CART WIDGET
   ======================================== */

.mini-cart-widget {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    padding: 15px 20px;
    border-radius: 30px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    z-index: 1000;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.mini-cart-widget:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    transform: scale(1.05);
}

.mini-cart-widget .cart-icon {
    font-size: 1.5em;
}

.mini-cart-widget .cart-count {
    background: #e74c3c;
    color: white;
    border-radius: 50%;
    padding: 2px 8px;
    font-size: 0.85em;
    font-weight: bold;
    min-width: 25px;
    text-align: center;
}

.mini-cart-widget .cart-total {
    font-weight: bold;
    color: #2c3e50;
    margin-left: 5px;
}

/* ========================================
   PRODUCT FILTER SIDEBAR
   ======================================== */

.filter-sidebar {
    background: white;
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.filter-sidebar h3 {
    margin-bottom: 15px;
    color: #2c3e50;
    font-size: 1.2em;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
}

.filter-group {
    margin-bottom: 25px;
}

.filter-group h4 {
    font-size: 1em;
    color: #34495e;
    margin-bottom: 12px;
    font-weight: 600;
}

.filter-group label {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    cursor: pointer;
    padding: 8px;
    border-radius: 5px;
    transition: background 0.2s;
}

.filter-group label:hover {
    background: #f8f9fa;
}

.filter-group input[type="checkbox"],
.filter-group input[type="radio"] {
    margin-right: 10px;
    cursor: pointer;
    width: 18px;
    height: 18px;
}

.price-range-slider {
    width: 100%;
    margin-top: 10px;
}

.price-range-values {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    font-size: 0.9em;
    color: #7f8c8d;
}

.filter-apply-btn {
    width: 100%;
    padding: 12px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    margin-top: 15px;
    transition: background 0.3s;
}

.filter-apply-btn:hover {
    background: #764ba2;
}

.filter-reset-btn {
    width: 100%;
    padding: 12px;
    background: #95a5a6;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    margin-top: 10px;
    transition: background 0.3s;
}

.filter-reset-btn:hover {
    background: #7f8c8d;
}

/* ========================================
   SEARCH BAR
   ======================================== */

.custom-search-bar {
    position: relative;
    margin: 30px 0;
    max-width: 600px;
}

.custom-search-bar input {
    width: 100%;
    padding: 15px 50px 15px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 30px;
    font-size: 1em;
    transition: all 0.3s;
}

.custom-search-bar input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.2);
}

.custom-search-bar button {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: #667eea;
    border: none;
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    transition: background 0.3s;
    font-size: 1.2em;
}

.custom-search-bar button:hover {
    background: #764ba2;
}

/* ========================================
   NOTIFICATION POPUP
   ======================================== */

.notification-popup {
    position: fixed;
    top: -100px;
    right: 20px;
    background: #27ae60;
    color: white;
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 10000;
    transition: top 0.5s ease;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
}

.notification-popup.show {
    top: 80px;
}

.notification-popup.error {
    background: #e74c3c;
}

.notification-popup.info {
    background: #3498db;
}

.notification-popup.warning {
    background: #f39c12;
}

.notification-popup .icon {
    font-size: 1.3em;
}

/* ========================================
   LOADING SPINNER
   ======================================== */

.loading-spinner {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.loading-spinner.active {
    display: flex;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ========================================
   RESPONSIVE GRID SYSTEM
   ======================================== */

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    padding: 20px 0;
}

.layout-wrapper {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 30px;
    padding: 20px 0;
}

/* ========================================
   PROMOTIONAL BANNER
   ======================================== */

.promo-banner {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    text-align: center;
    border-radius: 10px;
    margin: 20px 0;
    font-size: 1.2em;
    font-weight: bold;
}

.promo-banner .discount {
    font-size: 2em;
    display: block;
    margin: 10px 0;
}

.promo-banner .timer {
    font-size: 1.5em;
    margin-top: 10px;
    font-family: 'Courier New', monospace;
}

/* ========================================
   QUICK VIEW MODAL
   ======================================== */

.quick-view-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.quick-view-modal.active {
    display: flex;
}

.quick-view-content {
    background: white;
    padding: 30px;
    border-radius: 15px;
    max-width: 800px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.quick-view-content .modal-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 20px;
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 2em;
    cursor: pointer;
    color: #7f8c8d;
    background: none;
    border: none;
    transition: color 0.3s;
}

.close-modal:hover {
    color: #e74c3c;
}

/* ========================================
   WISHLIST BUTTON
   ======================================== */

.wishlist-btn {
    position: absolute;
    top: 15px;
    left: 15px;
    background: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.3em;
    color: #e74c3c;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s;
    z-index: 10;
}

.wishlist-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

.wishlist-btn.active {
    background: #e74c3c;
    color: white;
}

/* ========================================
   PRODUCT RATING
   ======================================== */

.product-rating {
    display: flex;
    align-items: center;
    gap: 5px;
    margin: 10px 0;
}

.product-rating .stars {
    color: #f39c12;
    font-size: 1.1em;
}

.product-rating .rating-count {
    color: #7f8c8d;
    font-size: 0.9em;
}

/* ========================================
   SORT AND VIEW OPTIONS
   ======================================== */

.product-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.sort-dropdown {
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1em;
    cursor: pointer;
    background: white;
}

.sort-dropdown:focus {
    outline: none;
    border-color: #667eea;
}

.view-options {
    display: flex;
    gap: 10px;
}

.view-btn {
    padding: 8px 12px;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
}

.view-btn.active,
.view-btn:hover {
    border-color: #667eea;
    background: #667eea;
    color: white;
}

/* ========================================
   SCROLL TO TOP BUTTON
   ======================================== */

.scroll-top-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #667eea;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    display: none;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: all 0.3s;
}

.scroll-top-btn:hover {
    background: #764ba2;
    transform: translateY(-5px);
}

.scroll-top-btn.visible {
    display: block;
}

/* ========================================
   PAGINATION
   ======================================== */

.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 40px 0;
}

.pagination button {
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
}

.pagination button:hover {
    border-color: #667eea;
    background: #667eea;
    color: white;
}

.pagination button.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.pagination button:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

/* ========================================
   BREADCRUMBS
   ======================================== */

.breadcrumbs {
    display: flex;
    gap: 10px;
    margin: 20px 0;
    font-size: 0.9em;
    color: #7f8c8d;
}

.breadcrumbs a {
    color: #667eea;
    text-decoration: none;
    transition: color 0.3s;
}

.breadcrumbs a:hover {
    color: #764ba2;
}

.breadcrumbs .separator {
    color: #bdc3c7;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 1024px) {
    .layout-wrapper {
        grid-template-columns: 200px 1fr;
        gap: 20px;
    }

    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

@media (max-width: 768px) {
    .layout-wrapper {
        grid-template-columns: 1fr;
    }

    .filter-sidebar {
        margin-bottom: 20px;
    }

    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 15px;
    }

    .mini-cart-widget {
        top: 10px;
        right: 10px;
        padding: 10px 15px;
    }

    .promo-banner {
        font-size: 1em;
        padding: 15px;
    }

    .promo-banner .discount {
        font-size: 1.5em;
    }

    .quick-view-content .modal-grid {
        grid-template-columns: 1fr;
    }

    .product-controls {
        flex-direction: column;
        gap: 15px;
    }

    .notification-popup.show {
        top: 60px;
        right: 10px;
        left: 10px;
    }
}

@media (max-width: 480px) {
    .product-grid {
        grid-template-columns: 1fr;
    }

    .custom-product-card {
        margin: 10px 0;
    }

    .scroll-top-btn {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
    }
}

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
    .mini-cart-widget,
    .scroll-top-btn,
    .notification-popup,
    .filter-sidebar,
    .add-to-cart-btn,
    .wishlist-btn {
        display: none !important;
    }
}

/* ========================================
   ACCESSIBILITY IMPROVEMENTS
   ======================================== */

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

button:focus,
input:focus,
select:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .custom-product-card {
        border: 2px solid #000;
    }

    .add-to-cart-btn {
        border: 2px solid #fff;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}