/* Shop Page Optimized Styles */

/* ============================================================================
   HERO SECTION
   ============================================================================ */
.shop-hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 60px 0;
    margin-bottom: 50px;
    color: white;
    position: relative;
    overflow: hidden;
}

.shop-hero::before,
.shop-hero::after {
    content: '';
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.shop-hero::before {
    top: 0;
    right: 0;
    width: 400px;
    height: 400px;
    transform: translate(100px, -100px);
}

.shop-hero::after {
    bottom: 0;
    left: 0;
    width: 300px;
    height: 300px;
    transform: translate(-50px, 100px);
}

.shop-hero-content {
    position: relative;
    z-index: 1;
}

.shop-hero h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 20px;
    letter-spacing: -1px;
}

.shop-hero p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    opacity: 0.95;
}

.shop-search-container {
    display: gap: 20px;
    margin-top: 30px;
}

.shop-search-input {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.shop-search-input .form-control {
    padding: 12px 18px;
    border: none;
    font-size: 1rem;
}

.shop-search-input .btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 12px 25px;
    transition: background 0.3s ease;
}

.shop-search-input .btn:hover {
    background: #5568d3;
}

.shop-quick-filters {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.shop-quick-filters span {
    opacity: 0.8;
    font-size: 0.9rem;
}

.shop-filter-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.shop-filter-btn:hover,
.shop-filter-btn.active {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* ============================================================================
   SIDEBAR FILTERS
   ============================================================================ */
.shop-filters-card {
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    margin-bottom: 3rem;
}

.shop-filters-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 8px 8px 0 0;
    color: white;
    padding: 20px;
}

.shop-filters-header h5 {
    font-weight: 600;
    margin: 0;
}

.shop-filters-body {
    padding: 20px;
}

.shop-filter-group {
    margin-bottom: 25px;
}

.shop-filter-group h6 {
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
}

.shop-filter-group .form-check {
    margin-bottom: 12px;
}

.shop-filter-group .form-check-input {
    width: 18px;
    height: 18px;
    border: 2px solid #ddd;
    cursor: pointer;
}

.shop-filter-group .form-check-input:checked {
    background-color: #667eea;
    border-color: #667eea;
}

.shop-filter-group .form-check-label {
    cursor: pointer;
    margin-left: 10px;
    font-size: 0.95rem;
}

.shop-sort-select {
    border-radius: 6px;
    border: 1px solid #ddd;
    padding: 8px 12px;
    width: 100%;
}

.shop-apply-filters-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    padding: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.shop-apply-filters-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

/* ============================================================================
   PRODUCT CARDS
   ============================================================================ */
.shop-card {
    border: 1px solid #e9ecef;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.shop-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

.shop-card-image-container {
    height: 220px;
    background: linear-gradient(135deg, #f5f7fa 0%, #e9ecef 100%);
    overflow: hidden;
    position: relative;
}

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

.shop-card:hover .shop-card-image {
    transform: scale(1.08);
}

/* Image loading placeholder */
.shop-card-image.loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Category badges */
.shop-badge-category {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 8px 12px;
    font-size: 0.75rem;
    border-radius: 6px;
    font-weight: 600;
    z-index: 10;
}

.shop-badge-web {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.shop-badge-mobile {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.shop-badge-design {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    color: #333;
}

.shop-badge-discount {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    padding: 12px 8px;
    font-size: 0.7rem;
    border-radius: 6px;
    color: white;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    text-align: center;
    min-width: 50px;
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
    font-weight: 700;
    z-index: 11;
}

.shop-badge-discount .discount-percent {
    font-size: 1.2rem;
}

.shop-badge-discount .discount-label {
    font-size: 0.65rem;
    margin-top: 2px;
}

.shop-badge-emoji {
    position: absolute;
    top: 12px;
    left: 12px;
    font-size: 1.5rem;
    z-index: 10;
}

.shop-badge-stock {
    position: absolute;
    bottom: 12px;
    left: 12px;
    padding: 6px 12px;
    font-size: 0.75rem;
    border-radius: 20px;
    background: white;
    font-weight: 600;
    z-index: 10;
}

.shop-badge-stock.in-stock {
    color: #28a745;
}

.shop-badge-stock.low-stock {
    color: #ffc107;
}

.shop-badge-stock.out-of-stock {
    color: #dc3545;
}

/* Card body */
.shop-card-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.shop-card-title {
    font-weight: 700;
    margin-bottom: 10px;
    font-size: 1.1rem;
    color: #333;
    line-height: 1.4;
}

.shop-card-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.shop-card-title a:hover {
    color: #667eea;
}

.shop-card-description {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 15px;
    line-height: 1.5;
    flex-grow: 1;
}

.shop-card-rating {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.shop-card-rating .stars {
    color: #ffc107;
}

.shop-card-pricing {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.shop-card-price-original {
    font-size: 0.85rem;
    text-decoration: line-through;
    color: #999;
    margin-bottom: 4px;
}

.shop-card-price {
    font-size: 1.3rem;
    font-weight: 700;
    color: #667eea;
}

.shop-card-price.discounted {
    color: #ff6b6b;
}

.shop-card-views {
    color: #999;
    font-size: 0.85rem;
}

.shop-card-views i {
    color: #667eea;
    margin-right: 4px;
}

/* Card footer */
.shop-card-footer {
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    padding: 15px;
    border-radius: 0;
    display: flex;
    gap: 10px;
    margin-top: auto;
}

.shop-card-btn {
    flex: 1;
    padding: 10px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.shop-card-view-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.shop-card-view-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.shop-card-add-btn {
    background: #28a745;
    color: white;
    flex: 0.8;
}

.shop-card-add-btn:hover {
    background: #218838;
    transform: translateY(-2px);
}

.shop-card-wishlist-btn {
    background: #f0f0f0;
    color: #dc3545;
    flex: 0.5;
    position: relative;
}

.shop-card-wishlist-btn:hover {
    background: #ffebee;
}

.shop-card-wishlist-btn.active {
    background: #dc3545;
    color: white;
}

/* ============================================================================
   PAGINATION
   ============================================================================ */
.shop-pagination {
    display: flex;
    justify-content: center;
    margin-top: 40px;
    gap: 8px;
}

.pagination {
    gap: 8px;
}

.page-link {
    border: 1px solid #ddd;
    color: #667eea;
    padding: 10px 14px;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.page-link:hover:not(.disabled) {
    background: #667eea;
    color: white;
    border-color: #667eea;
    transform: translateY(-2px);
}

.page-item.active .page-link {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
}

.page-item.disabled .page-link {
    color: #999;
    background: #f0f0f0;
}

/* ============================================================================
   EMPTY STATE
   ============================================================================ */
.shop-empty-card {
    text-align: center;
    padding: 60px 20px;
}

.shop-empty-card i {
    font-size: 3rem;
    color: #ddd;
    margin-bottom: 20px;
}

.shop-empty-card h5 {
    font-weight: 700;
    color: #333;
    margin-bottom: 10px;
}

.shop-empty-card p {
    color: #999;
    margin-bottom: 20px;
}

.shop-empty-card .btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 10px 25px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.shop-empty-card .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

/* ============================================================================
   RESPONSIVE DESIGN
   ============================================================================ */
@media (max-width: 768px) {
    .shop-hero h1 {
        font-size: 2rem;
    }

    .shop-hero p {
        font-size: 1rem;
    }

    .shop-search-container {
        flex-direction: column;
    }

    .shop-quick-filters {
        justify-content: center;
    }

    .shop-filter-btn {
        padding: 8px 12px;
        font-size: 0.85rem;
    }

    /* Sidebar becomes a drawer on mobile */
    .shop-sidebar {
        position: fixed;
        left: -100%;
        top: 0;
        width: 100%;
        max-width: 300px;
        height: 100vh;
        background: white;
        z-index: 1000;
        transition: left 0.3s ease;
        overflow-y: auto;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    }

    .shop-sidebar.open {
        left: 0;
    }

    .shop-sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }

    .shop-sidebar.open ~ .shop-sidebar-overlay {
        opacity: 1;
        visibility: visible;
    }

    .shop-card-image-container {
        height: 180px;
    }

    .shop-card-btn {
        padding: 8px;
        font-size: 0.85rem;
    }

    .shop-badge-discount {
        padding: 8px 6px;
        right: 8px;
        min-width: 45px;
    }

    .shop-badge-discount .discount-percent {
        font-size: 1rem;
    }
}

@media (max-width: 576px) {
    .shop-hero {
        padding: 40px 0;
        margin-bottom: 30px;
    }

    .shop-hero h1 {
        font-size: 1.5rem;
    }

    .shop-hero p {
        font-size: 0.95rem;
        margin-bottom: 20px;
    }

    .shop-hero::before {
        width: 250px;
        height: 250px;
        transform: translate(80px, -80px);
    }

    .shop-hero::after {
        width: 200px;
        height: 200px;
        transform: translate(-40px, 80px);
    }

    .shop-card-image-container {
        height: 150px;
    }

    .shop-card-body {
        padding: 15px;
    }

    .shop-card-title {
        font-size: 0.95rem;
    }

    .shop-card-footer {
        padding: 10px;
    }

    .shop-card-btn {
        padding: 8px;
        font-size: 0.8rem;
    }

    .shop-filter-btn {
        padding: 6px 10px;
        font-size: 0.8rem;
    }
}

/* ============================================================================
   UTILITY CLASSES
   ============================================================================ */
.shop-loading {
    opacity: 0.6;
    pointer-events: none;
}

.shop-success {
    animation: slideInTop 0.3s ease;
}

@keyframes slideInTop {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Accessibility improvements */
.shop-card-btn:focus,
.shop-filter-btn:focus,
.page-link:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* ============================================================================
   TOAST NOTIFICATIONS
   ============================================================================ */
.shop-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    max-width: 400px;
    padding: 16px 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    pointer-events: none;
}

.shop-toast.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.shop-toast-content {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.95rem;
}

.shop-toast-success {
    border-left: 4px solid #28a745;
}

.shop-toast-success .shop-toast-content i {
    color: #28a745;
}

.shop-toast-info {
    border-left: 4px solid #17a2b8;
}

.shop-toast-info .shop-toast-content i {
    color: #17a2b8;
}

/* Mobile positioning */
@media (max-width: 576px) {
    .shop-toast {
        bottom: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
}

/* ============================================================================
   WISHLIST ACTIVE STATE
   ============================================================================ */
.shop-card-wishlist-btn {
    color: #ccc;
    transition: all 0.3s ease;
}

.shop-card-wishlist-btn:hover {
    color: #e74c3c;
    transform: scale(1.1);
}

.shop-card-wishlist-btn.active {
    color: #e74c3c;
    fill: currentColor;
}

.shop-card-wishlist-btn.active:hover {
    transform: scale(1.15);
}

/* Touch target improvements */
@media (hover: none) and (pointer: coarse) {
    .shop-filter-btn,
    .shop-card-btn,
    .page-link {
        min-height: 48px;
        min-width: 48px;
    }
}
