/* =====================================================
   STORE PAGE STYLES
   ===================================================== */

.store-page {
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

/* Store Header */
.store-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    color: white;
}

.store-header-content h1 {
    margin: 0 0 8px 0;
    font-size: 28px;
    font-weight: 700;
}

.store-header-content p {
    margin: 0;
    opacity: 0.9;
    font-size: 14px;
}

.btn-create-product {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: white;
    color: #667eea;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-create-product:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

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

/* Filters */
.store-filters {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
    padding: 16px 20px;
    background: var(--card-bg, #fff);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.store-filters-left {
    display: flex;
    gap: 12px;
}

.store-filters-right {
    display: flex;
    gap: 12px;
}

.filter-group {
    position: relative;
}

.store-filter-select {
    padding: 10px 36px 10px 14px;
    border: 1px solid var(--border-color, #e0e0e0);
    border-radius: 8px;
    background: var(--input-bg, #fff);
    font-size: 14px;
    cursor: pointer;
    min-width: 150px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.search-group {
    display: flex;
    align-items: stretch;
}

.store-search-input {
    padding: 10px 14px;
    border: 1px solid var(--border-color, #e0e0e0);
    border-radius: 8px 0 0 8px;
    font-size: 14px;
    min-width: 200px;
    background: var(--input-bg, #fff);
}

.store-search-btn {
    padding: 10px 14px;
    border: 1px solid var(--border-color, #e0e0e0);
    border-left: none;
    border-radius: 0 8px 8px 0;
    background: var(--primary-color, #667eea);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.store-search-btn:hover {
    background: var(--primary-hover, #5a6fd6);
}

/* Results Info */
.store-results-info {
    margin-bottom: 20px;
    color: var(--text-muted, #666);
    font-size: 14px;
}

/* Products Grid */
.store-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 24px;
}

/* Product Card */
.product-card {
    background: var(--card-bg, #fff);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: transform 0.2s, box-shadow 0.2s;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}

.product-card-image {
    display: block;
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
}

.product-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

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

.product-card-stock {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.product-card-stock.in-stock {
    background: #10b981;
    color: white;
}

.product-card-stock.sold-out {
    background: #ef4444;
    color: white;
}

.product-card-content {
    padding: 16px;
}

.product-card-category {
    display: inline-block;
    padding: 4px 8px;
    background: var(--badge-bg, #f0f0f0);
    color: var(--text-muted, #666);
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.product-card-title {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.3;
}

.product-card-title a {
    color: var(--text-primary, #1a1a1a);
    text-decoration: none;
}

.product-card-title a:hover {
    color: var(--primary-color, #667eea);
}

.product-card-rating {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
}

.product-card-rating .stars {
    display: flex;
    gap: 2px;
}

.product-card-rating .star {
    font-size: 14px;
}

.product-card-rating .star.filled {
    color: #fbbf24;
}

.product-card-rating .star.empty {
    color: #d1d5db;
}

.product-card-rating .reviews-count {
    color: var(--text-muted, #666);
    font-size: 12px;
}

.product-card-seller {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color, #e0e0e0);
}

.product-card-seller img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}

.product-card-seller a {
    color: var(--text-muted, #666);
    font-size: 13px;
    text-decoration: none;
}

.product-card-seller a:hover {
    color: var(--primary-color, #667eea);
}

.product-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.product-card-price {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-color, #667eea);
}

.btn-cart {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--primary-color, #667eea);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
}

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

.btn-cart:hover {
    background: var(--primary-hover, #5a6fd6);
    transform: scale(1.1);
}

.btn-cart.in-cart {
    background: #10b981;
}

.btn-cart.in-cart:hover {
    background: #059669;
}

/* Empty State */
.store-empty {
    text-align: center;
    padding: 60px 20px;
    background: var(--card-bg, #fff);
    border-radius: 12px;
}

.store-empty-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: var(--badge-bg, #f0f0f0);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.store-empty-icon svg {
    width: 40px;
    height: 40px;
    color: var(--text-muted, #666);
}

.store-empty h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
    color: var(--text-primary, #1a1a1a);
}

.store-empty p {
    margin: 0;
    color: var(--text-muted, #666);
    font-size: 14px;
}

/* Pagination */
.store-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 30px;
}

.store-pagination .pagination-item {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--card-bg, #fff);
    color: var(--text-primary, #1a1a1a);
    text-decoration: none;
    font-weight: 500;
    transition: background 0.2s;
}

.store-pagination .pagination-item:hover {
    background: var(--hover-bg, #f5f5f5);
}

.store-pagination .pagination-item.active {
    background: var(--primary-color, #667eea);
    color: white;
}

/* Night Mode */
.night-mode .store-header {
    background: linear-gradient(135deg, #4c5fd5 0%, #5b3f8c 100%);
}

.night-mode .store-filters,
.night-mode .product-card,
.night-mode .store-empty,
.night-mode .store-pagination .pagination-item {
    background: #1a1a2e;
}

.night-mode .store-filter-select,
.night-mode .store-search-input {
    background: #16213e;
    border-color: #2a2a4e;
    color: #e0e0e0;
}

.night-mode .product-card-title a {
    color: #e0e0e0;
}

.night-mode .product-card-category {
    background: #2a2a4e;
    color: #a0a0a0;
}

.night-mode .product-card-seller {
    border-bottom-color: #2a2a4e;
}

/* Responsive */
@media (max-width: 768px) {
    .store-header {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }

    .store-filters {
        flex-direction: column;
    }

    .store-filters-left,
    .store-filters-right {
        width: 100%;
    }

    .store-filter-select,
    .store-search-input {
        width: 100%;
    }

    .search-group {
        width: 100%;
    }

    .store-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 16px;
    }
}

@media (max-width: 480px) {
    .store-page {
        padding: 12px;
    }

    .store-header {
        padding: 20px;
    }

    .store-header-content h1 {
        font-size: 22px;
    }

    .store-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .product-card-content {
        padding: 12px;
    }

    .product-card-title {
        font-size: 14px;
    }

    .product-card-price {
        font-size: 16px;
    }
}

/* =====================================================
   CART HEADER DROPDOWN
   ===================================================== */

.cart-header-dropdown .cart-count {
    position: absolute;
    top: -2px;
    right: -2px;
    font-size: 10px;
}

.cart-header-dropdown .cart-count b {
    background: var(--main-color, #5c6bc0);
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 10px;
    line-height: 1;
}

.cart-dropdown {
    width: 320px;
    padding: 0;
    max-height: 400px;
    overflow: hidden;
}

.cart-dropdown > li:first-child h5 {
    margin: 0;
    padding: 15px;
    border-bottom: 1px solid var(--border-color, #e0e0e0);
    font-size: 14px;
    font-weight: 600;
}

.cart-items-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 280px;
    overflow-y: auto;
}

.cart-items-list .cart-item {
    border-bottom: 1px solid var(--border-color, #e0e0e0);
}

.cart-items-list .cart-item:last-child {
    border-bottom: none;
}

.cart-items-list .cart-item a {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    gap: 12px;
    color: inherit;
    text-decoration: none;
    transition: background 0.2s;
}

.cart-items-list .cart-item a:hover {
    background: var(--hover-bg, #f5f5f5);
}

.cart-items-list .cart-item img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 8px;
}

.cart-item-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.cart-item-title {
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cart-item-price {
    font-size: 12px;
    color: var(--text-secondary, #666);
    margin-top: 4px;
}

.cart-items-list .cart-empty,
.cart-items-list .cart-more {
    padding: 20px 15px;
    text-align: center;
    color: var(--text-secondary, #666);
    font-size: 13px;
}

.cart-items-list .cart-loading-item {
    padding: 30px;
    text-align: center;
}

.cart-footer {
    padding: 12px 15px;
    border-top: 1px solid var(--border-color, #e0e0e0);
}

.cart-footer .btn {
    width: 100%;
}

.cart-loading {
    height: 2px;
    background: var(--border-color, #e0e0e0);
    position: relative;
    overflow: hidden;
}

.cart-loading .indeterminate {
    position: absolute;
    height: 100%;
    background: var(--main-color, #5c6bc0);
    animation: indeterminate 1.5s infinite linear;
}

@keyframes indeterminate {
    0% { left: -35%; right: 100%; }
    60% { left: 100%; right: -90%; }
    100% { left: 100%; right: -90%; }
}
