/* Global Variables */
:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --accent-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --success-gradient: linear-gradient(135deg, #56ab2f 0%, #a8e6cf 100%);
    --text-primary: #1a202c;
    --text-secondary: #4a5568;
    --text-muted: #718096;
    --bg-primary: #ffffff;
    --bg-secondary: #f7fafc;
    --bg-tertiary: #edf2f7;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

/* Page Header */
.page-header {
    background: var(--primary-gradient);
    color: white;
    padding: 8rem 0 4rem;
    position: relative;
    overflow: hidden;
}

.header-overlay {
    position: absolute;
    inset: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
}

.header-content {
    position: relative;
    z-index: 2;
    text-align: center;
}

.breadcrumb-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
    font-size: 0.875rem;
}

.breadcrumb-item {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: var(--transition);
}

.breadcrumb-item:hover {
    color: white;
}

.breadcrumb-separator {
    color: rgba(255, 255, 255, 0.6);
}

.breadcrumb-separator svg {
    width: 16px;
    height: 16px;
}

.breadcrumb-current {
    color: white;
    font-weight: 600;
}

.page-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #ffffff 0%, #e2e8f0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-description {
    font-size: 1.125rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

/* Shop Section */
.shop-section {
    padding: 4rem 0;
    background: var(--bg-secondary);
    margin-top: 1rem;
}

.shop-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 3rem;
    align-items: start;
}

/* Sidebar */
.shop-sidebar {
    position: sticky;
    top: 2rem;
}

.sidebar-content {
    background: var(--bg-primary);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.widget {
    margin-bottom: 2.5rem;
}

.widget:last-child {
    margin-bottom: 0;
}

.widget-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    position: relative;
}

.widget-title::after {
    content: '';
    position: absolute;
    bottom: -0.5rem;
    left: 0;
    width: 40px;
    height: 3px;
    background: var(--primary-gradient);
    border-radius: 2px;
}

/* Search Widget */
.search-input-group {
    position: relative;
    background: var(--bg-secondary);
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid transparent;
    transition: var(--transition);
}

.search-input-group:focus-within {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-input {
    width: 100%;
    padding: 1rem 3rem 1rem 1rem;
    border: none;
    background: transparent;
    font-size: 1rem;
    color: var(--text-primary);
}

.search-input:focus {
    outline: none;
}

.search-btn {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: var(--primary-gradient);
    border: none;
    border-radius: 8px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.search-btn:hover {
    transform: translateY(-50%) scale(1.05);
}

.search-btn svg {
    width: 18px;
    height: 18px;
}

/* Categories Widget */
.categories-widget {
    position: relative;
}

.categories-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    padding: 0.5rem 0;
}

.categories-header .widget-title {
    margin-bottom: 0;
}

.categories-toggle {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.categories-toggle.active {
    transform: rotate(180deg);
}

.categories-toggle svg {
    width: 16px;
    height: 16px;
    color: var(--text-secondary);
}

.categories-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.categories-list.active {
    max-height: 500px;
    margin-top: 1rem;
}

.category-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border-radius: 10px;
    text-decoration: none;
    color: var(--text-secondary);
    transition: var(--transition);
    border: 2px solid transparent;
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.3s ease;
}

.categories-list.active .category-item {
    opacity: 1;
    transform: translateX(0);
}

.category-item:hover, .category-item.active {
    background: var(--primary-gradient);
    color: white;
    border-color: transparent;
    transform: translateX(5px);
}

.category-name {
    font-weight: 500;
}

.category-count {
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-muted);
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    transition: var(--transition);
}

.category-item.active .category-count,
.category-item:hover .category-count {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* Price Widget */
.price-inputs {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.price-input-group {
    flex: 1;
}

.price-input-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.price-input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: var(--transition);
}

.price-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.price-separator {
    font-weight: 600;
    color: var(--text-muted);
    margin-top: 1.5rem;
}

.price-apply-btn {
    width: 100%;
    padding: 0.875rem;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.price-apply-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Featured Products Widget */
.featured-products {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.featured-product {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: 12px;
    transition: var(--transition);
}

.featured-product:hover {
    background: white;
    box-shadow: var(--shadow-md);
}

.featured-image {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
}

.featured-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.featured-info {
    flex: 1;
}

.featured-name {
    margin-bottom: 0.5rem;
}

.featured-name a {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 600;
    transition: var(--transition);
}

.featured-name a:hover {
    color: #667eea;
}

.featured-price {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.featured-price .current-price {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 0.875rem;
}

.featured-price .old-price {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-decoration: line-through;
}

/* Main Content */
.shop-main {
    min-height: 600px;
}

/* Filter Bar */
.filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-primary);
    padding: 1.5rem 2rem;
    border-radius: 16px;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.results-info {
    color: var(--text-secondary);
    font-size: 1rem;
}

.results-count {
    font-weight: 700;
    color: var(--text-primary);
}

.filter-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.sort-select {
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.875rem;
    cursor: pointer;
    transition: var(--transition);
}

.sort-select:focus {
    outline: none;
    border-color: #667eea;
}

.view-toggle {
    display: flex;
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 0.25rem;
}

.view-btn {
    padding: 0.5rem;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-muted);
}

.view-btn.active {
    background: var(--primary-gradient);
    color: white;
}

.view-btn svg {
    width: 18px;
    height: 18px;
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    margin-bottom: 3rem;
}

.products-grid.list-view {
    grid-template-columns: 1fr;
}

.products-grid.list-view .product-card {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.products-grid.list-view .product-image-container {
    width: 200px;
    flex-shrink: 0;
}

.products-grid.list-view .product-info {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Product Card */
.product-card {
    background: var(--bg-primary);
    border-radius: 20px;
    overflow: hidden;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
    border-color: transparent;
}

.product-image-container {
    position: relative;
    overflow: hidden;
}

.product-image-wrapper {
    position: relative;
    aspect-ratio: 4/3;
    overflow: hidden;
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.product-card:hover .product-image {
    transform: scale(1.1);
}

.product-badge {
    position: absolute;
    top: 1rem;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 2;
}

.sale-badge {
    right: 1rem;
    background: var(--secondary-gradient);
    color: white;
}

.new-badge {
    left: 1rem;
    background: var(--success-gradient);
    color: white;
}

.product-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
}

.product-card:hover .product-overlay {
    opacity: 1;
}

.product-actions {
    display: flex;
    gap: 0.75rem;
}

.action-btn {
    width: 48px;
    height: 48px;
    background: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    color: var(--text-primary);
}

.action-btn:hover {
    background: var(--primary-gradient);
    color: white;
    transform: scale(1.1);
}

.action-btn svg {
    width: 20px;
    height: 20px;
}

.inline-form {
    display: inline;
}

/* Product Info */
.product-info {
    padding: 1.5rem;
}

.product-brand {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.product-name {
    margin-bottom: 0.75rem;
}

.product-name a {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 1.125rem;
    font-weight: 600;
    transition: var(--transition);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-name a:hover {
    color: #667eea;
}

.product-rating {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.stars {
    display: flex;
    gap: 0.125rem;
}

.star {
    width: 14px;
    height: 14px;
    color: #e2e8f0;
    transition: var(--transition);
}

.star.filled {
    color: #fbbf24;
}

.rating-text {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.product-price {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.current-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.old-price {
    font-size: 1rem;
    color: var(--text-muted);
    text-decoration: line-through;
}

/* No Products */
.no-products {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--bg-primary);
    border-radius: 20px;
    box-shadow: var(--shadow-sm);
}

.no-products-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 2rem;
    color: var(--text-muted);
}

.no-products-icon svg {
    width: 100%;
    height: 100%;
}

.no-products h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.no-products p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    padding: 0.875rem 2rem;
    background: var(--primary-gradient);
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    transition: var(--transition);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    color: white;
}

/* Pagination */
.pagination-container {
    display: flex;
    justify-content: center;
}

.pagination-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.page-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.page-link:hover {
    background: var(--primary-gradient);
    border-color: transparent;
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.page-link.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.page-link svg {
    width: 16px;
    height: 16px;
}

.page-info {
    padding: 0.75rem 1.5rem;
    background: var(--bg-secondary);
    border-radius: 12px;
    color: var(--text-primary);
    font-weight: 600;
    border: 2px solid var(--border-color);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .shop-layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    .shop-sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100vh;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1000;
        transition: all 0.3s ease;
        opacity: 0;
        visibility: hidden;
    }

    .shop-sidebar.active {
        left: 0;
        opacity: 1;
        visibility: visible;
    }

    .sidebar-content {
        position: absolute;
        top: 0;
        left: 0;
        width: 320px;
        height: 100%;
        overflow-y: auto;
        background: var(--bg-primary);
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        padding: 2rem;
    }

    .shop-sidebar.active .sidebar-content {
        transform: translateX(0);
    }

    .sidebar-close {
        position: absolute;
        top: 1rem;
        right: 1rem;
        width: 32px;
        height: 32px;
        background: var(--bg-secondary);
        border: none;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        z-index: 1001;
        transition: var(--transition);
    }

    .sidebar-close:hover {
        background: var(--primary-color);
        color: white;
    }

    .sidebar-close svg {
        width: 16px;
        height: 16px;
        color: var(--text-primary);
    }

    .filter-toggle {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        padding: 0.75rem 1rem;
        background: var(--bg-primary);
        border: 1px solid var(--border-color);
        border-radius: 8px;
        color: var(--text-primary);
        font-weight: 500;
        cursor: pointer;
        margin-right: 1rem;
        transition: var(--transition);
    }

    .filter-toggle:hover {
        background: var(--primary-color);
        color: white;
        border-color: var(--primary-color);
    }

    .filter-toggle svg {
        width: 16px;
        height: 16px;
    }

    .filter-left {
        display: flex;
        align-items: center;
    }

    .results-info {
        font-size: 0.875rem;
    }
}

@media (max-width: 768px) {
    .page-header {
        padding: 6rem 0 3rem;
    }

    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .sidebar-content {
        grid-template-columns: 1fr;
    }

    .filter-right {
        flex-direction: column;
    }

    .products-grid.list-view .product-card {
        flex-direction: column;
    }

    .products-grid.list-view .product-image-container {
        width: 100%;
    }

    .products-grid.list-view .product-info {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: 1fr;
    }

    .product-actions {
        gap: 0.5rem;
    }

    .action-btn {
        width: 40px;
        height: 40px;
    }
}

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

.product-card {
    animation: fadeIn 0.5s ease forwards;
}

.product-card:nth-child(2) { animation-delay: 0.1s; }
.product-card:nth-child(3) { animation-delay: 0.2s; }
.product-card:nth-child(4) { animation-delay: 0.3s; }
.product-card:nth-child(5) { animation-delay: 0.4s; }
.product-card:nth-child(6) { animation-delay: 0.5s; }
.product-card:nth-child(7) { animation-delay: 0.6s; }
.product-card:nth-child(8) { animation-delay: 0.7s; }

/* Loading State */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Filter Transitions */
.filter-transition {
    transition: all 0.3s ease;
}

.filter-transition-enter {
    opacity: 0;
    transform: translateY(20px);
}

.filter-transition-enter-active {
    opacity: 1;
    transform: translateY(0);
}

.filter-transition-exit {
    opacity: 1;
    transform: translateY(0);
}

.filter-transition-exit-active {
    opacity: 0;
    transform: translateY(-20px);
}

/* Header Adjustments */
.header-bottom {
    padding: 0.75rem 0 !important;
}

.header-bottom .logo {
    display: flex;
    align-items: center;
}

.header-bottom .logo img {
    max-height: 50px;
    width: auto;
    object-fit: contain;
}

.header-bottom .main-menu ul li a {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.header-action-style {
    padding: 0.5rem;
}

.header-action-style i {
    font-size: 1.2rem;
}

.product-count {
    top: -5px;
    right: -5px;
    width: 18px;
    height: 18px;
    font-size: 0.7rem;
    line-height: 18px;
}