/**
 * White Phoenix Theme - Main CSS
 * Author: MAKcubes
 */

/* CSS Variables (Design Tokens) */
:root {
    --primary-color: #000000;
    --secondary-color: #666666;
    --accent-color: #ff6b6b;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    
    --white: #ffffff;
    --gray-100: #f8f9fa;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: #adb5bd;
    --gray-600: #6c757d;
    --gray-700: #495057;
    --gray-800: #343a40;
    --gray-900: #212529;
    --black: #000000;
    
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    --font-secondary: 'Poppins', 'Inter', sans-serif;
    
    --transition-default: all 0.3s ease;
    --shadow-default: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-hover: 0 4px 12px rgba(0,0,0,0.15);
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-primary);
    color: var(--gray-800);
    background-color: var(--white);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Header Styles */
.site-header {
    background-color: var(--white);
    box-shadow: var(--shadow-default);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
}

.site-branding {
    flex-shrink: 0;
}

.site-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

.site-title a {
    color: var(--primary-color);
    text-decoration: none;
}

/* Navigation */
.main-navigation {
    flex-grow: 1;
    margin-left: 30px;
}

.primary-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.primary-menu li {
    position: relative;
}

.primary-menu li a {
    display: block;
    padding: 10px 15px;
    color: var(--gray-800);
    text-decoration: none;
    transition: var(--transition-default);
}

.primary-menu li a:hover {
    color: var(--accent-color);
}

/* Mega Menu */
.menu-item-has-mega-menu {
    position: static;
}

.mega-menu-content {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--white);
    box-shadow: var(--shadow-hover);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-default);
    z-index: 999;
}

.menu-item-has-mega-menu:hover .mega-menu-content {
    opacity: 1;
    visibility: visible;
}

/* Product Card Styles */
.product-card {
    background-color: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    overflow: hidden;
    transition: var(--transition-default);
    margin-bottom: 30px;
    position: relative;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.product-card .product-image {
    position: relative;
    overflow: hidden;
}

.product-card .product-image img {
    width: 100%;
    transition: transform 0.5s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-card .product-info {
    padding: 15px;
}

.product-card .product-title {
    font-size: 1rem;
    margin: 0 0 10px;
    font-weight: 600;
}

.product-card .product-title a {
    color: var(--gray-800);
    text-decoration: none;
}

.product-card .product-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent-color);
    margin-bottom: 10px;
}

.product-card .product-price del {
    color: var(--gray-500);
    font-size: 0.875rem;
    margin-right: 8px;
}

.sale-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: var(--danger-color);
    color: var(--white);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 2;
}

.quick-view-btn {
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition-default);
    opacity: 0;
}

.product-card:hover .quick-view-btn {
    bottom: 15px;
    opacity: 1;
}

/* Add to Cart Button */
.add-to-cart-btn {
    display: inline-block;
    background-color: var(--accent-color);
    color: var(--white);
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    font-size: 0.875rem;
    transition: var(--transition-default);
}

.add-to-cart-btn:hover {
    background-color: var(--primary-color);
    color: var(--white);
}

/* Categories Grid */
.white-phoenix-categories-grid {
    display: grid;
    gap: 30px;
    margin: 30px 0;
}

.white-phoenix-categories-grid.columns-2 {
    grid-template-columns: repeat(2, 1fr);
}

.white-phoenix-categories-grid.columns-3 {
    grid-template-columns: repeat(3, 1fr);
}

.white-phoenix-categories-grid.columns-4 {
    grid-template-columns: repeat(4, 1fr);
}

.white-phoenix-categories-grid.columns-5 {
    grid-template-columns: repeat(5, 1fr);
}

.white-phoenix-categories-grid.columns-6 {
    grid-template-columns: repeat(6, 1fr);
}

.category-item {
    text-align: center;
}

.category-image {
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 15px;
}

.category-image img {
    width: 100%;
    transition: transform 0.3s ease;
}

.category-item:hover .category-image img {
    transform: scale(1.05);
}

.category-title {
    font-size: 1.125rem;
    margin: 0 0 5px;
}

.category-title a {
    color: var(--gray-800);
    text-decoration: none;
}

.product-count {
    color: var(--gray-600);
    font-size: 0.875rem;
}

/* Footer */
.site-footer {
    background-color: var(--gray-900);
    color: var(--gray-400);
    padding: 60px 0 30px;
    margin-top: 60px;
}

.footer-widget-title {
    color: var(--white);
    margin-bottom: 20px;
    font-size: 1.125rem;
}

.site-info {
    text-align: center;
    padding-top: 30px;
    margin-top: 30px;
    border-top: 1px solid var(--gray-800);
    font-size: 0.875rem;
}

/* Responsive */
@media (max-width: 991px) {
    .white-phoenix-categories-grid.columns-4,
    .white-phoenix-categories-grid.columns-5,
    .white-phoenix-categories-grid.columns-6 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 767px) {
    .white-phoenix-categories-grid.columns-2,
    .white-phoenix-categories-grid.columns-3,
    .white-phoenix-categories-grid.columns-4,
    .white-phoenix-categories-grid.columns-5,
    .white-phoenix-categories-grid.columns-6 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .white-phoenix-categories-grid {
        grid-template-columns: repeat(1, 1fr);
    }
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 45px;
    height: 45px;
    background-color: var(--accent-color, #ff6b6b);
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background-color: var(--primary-color, #000);
    transform: translateY(-3px);
}

/* Notifications */
.white-phoenix-notification {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 12px 24px;
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    z-index: 10000;
    transition: transform 0.3s ease;
    white-space: nowrap;
}

.white-phoenix-notification.show {
    transform: translateX(-50%) translateY(0);
}

.white-phoenix-notification.success {
    background-color: #28a745;
}

.white-phoenix-notification.error {
    background-color: #dc3545;
}

.white-phoenix-notification.info {
    background-color: #17a2b8;
}

.white-phoenix-notification.warning {
    background-color: #ffc107;
    color: #333;
}

/* Wishlist Button */
.wishlist-btn {
    background: none;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #666;
    transition: all 0.3s ease;
}

.wishlist-btn.active {
    color: #ff6b6b;
}

.wishlist-btn:hover {
    color: #ff6b6b;
}

/* Compare Button */
.compare-btn {
    background: none;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #666;
    transition: all 0.3s ease;
}

.compare-btn:hover {
    color: var(--accent-color);
}

/* Swatches */
.swatches-container {
    margin-bottom: 20px;
}

.swatches-container label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
}

.swatches-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.swatch {
    cursor: pointer;
    transition: all 0.3s ease;
}

.swatch-color {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    border: 2px solid #ddd;
}

.swatch-color.active,
.swatch-color:hover {
    border-color: var(--accent-color);
    transform: scale(1.1);
}

.swatch-text {
    padding: 8px 16px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
}

.swatch-text.active,
.swatch-text:hover {
    border-color: var(--accent-color);
    background: var(--accent-color);
    color: #fff;
}

.swatch-image {
    width: 40px;
    height: 40px;
    background-size: cover;
    background-position: center;
    border-radius: 4px;
    border: 2px solid #ddd;
}

/* Loading State */
.products-grid.loading {
    position: relative;
    min-height: 200px;
}

.products-grid.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 3px solid #f3f3f3;
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Modal */
.white-phoenix-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
}

.modal-container {
    position: relative;
    width: 90%;
    max-width: 900px;
    margin: 50px auto;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    animation: modalFadeIn 0.3s ease;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 30px;
    height: 30px;
    background: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    z-index: 10;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.modal-content {
    padding: 30px;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-content.loading {
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loader {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    .modal-container {
        width: 95%;
        margin: 30px auto;
    }
    
    .modal-content {
        padding: 20px;
    }
}

/* ============================================
   Wishlist Button Styles
   ============================================ */
.wishlist-btn {
    background: transparent;
    border: 1px solid #e5e5e5;
    border-radius: 40px;
    padding: 8px 16px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #666;
    transition: all 0.3s ease;
}

.wishlist-btn:hover {
    border-color: #ff6b6b;
    color: #ff6b6b;
}

.wishlist-btn.active {
    background: #ff6b6b;
    border-color: #ff6b6b;
    color: #fff;
}

.wishlist-btn.active:hover {
    background: #ff5252;
}

/* ============================================
   Compare Button Styles
   ============================================ */
.compare-btn {
    background: transparent;
    border: 1px solid #e5e5e5;
    border-radius: 40px;
    padding: 8px 16px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #666;
    transition: all 0.3s ease;
}

.compare-btn:hover {
    border-color: #ff6b6b;
    color: #ff6b6b;
}

.compare-btn.active {
    background: #ff6b6b;
    border-color: #ff6b6b;
    color: #fff;
}

/* ============================================
   Back to Top Button
   ============================================ */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 45px;
    height: 45px;
    background: #ff6b6b;
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: #333;
    transform: translateY(-3px);
}

/* ============================================
   Notification System
   ============================================ */
.white-phoenix-notification {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 12px 24px;
    border-radius: 50px;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    z-index: 10000;
    transition: transform 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.white-phoenix-notification.show {
    transform: translateX(-50%) translateY(0);
}

/* ============================================
   Modal Styles
   ============================================ */
.white-phoenix-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: none;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
}

.modal-container {
    position: relative;
    width: 90%;
    max-width: 900px;
    margin: 50px auto;
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    animation: modalFadeIn 0.3s ease;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 35px;
    height: 35px;
    background: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: #ff6b6b;
    color: #fff;
}

.modal-content {
    padding: 30px;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-content.loading {
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loader {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top-color: #ff6b6b;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   Responsive Styles
   ============================================ */
@media (max-width: 768px) {
    .wishlist-btn,
    .compare-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .modal-container {
        width: 95%;
        margin: 30px auto;
    }
    
    .modal-content {
        padding: 20px;
    }
}