/* E-Stores Page Styles */

.e-stores-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
    padding-bottom: 100px; /* Space for bottom nav */
}

.page-header {
    text-align: center;
    margin-bottom: 2rem;
}

.page-title {
    font-size: 2rem;
    color: #283618;
    margin-bottom: 0.5rem;
}

.page-subtitle {
    font-size: 1.1rem;
    color: #606C38;
}

/* Filter Bar */
.filter-bar {
    background: #FEFAE0;
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 2rem;
}

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

.filter-select {
    flex: 1;
    padding: 0.75rem;
    border: 2px solid #BC6C25;
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    color: #283618;
    cursor: pointer;
}

/* Stores Grid */
.stores-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.store-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

.store-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.15);
}

.store-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #FEFAE0;
}

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

.placeholder-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    background: linear-gradient(135deg, #FEFAE0 0%, #F0E68C 100%);
}

.store-info {
    padding: 1.5rem;
}

.store-name {
    font-size: 1.3rem;
    color: #283618;
    margin-bottom: 0.5rem;
}

.store-badge {
    display: inline-block;
    background: linear-gradient(135deg, #BC6C25 0%, #8B4513 100%);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
}

.store-contact {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #606C38;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.whatsapp-icon {
    font-size: 1.2rem;
}

.btn-view-products {
    width: 100%;
    padding: 0.75rem;
    background: linear-gradient(135deg, #606C38 0%, #283618 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.3s;
}

.btn-view-products:hover {
    opacity: 0.9;
}

/* Store Products Page */
.store-products-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
    padding-bottom: 100px;
}

.back-button-container {
    margin-bottom: 1.5rem;
}

.btn-back {
    padding: 0.75rem 1.5rem;
    background: #FEFAE0;
    border: 2px solid #BC6C25;
    border-radius: 8px;
    color: #283618;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-back:hover {
    background: #BC6C25;
    color: white;
}

.store-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    background: white;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.store-logo,
.store-logo-placeholder {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
}

.store-logo-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #FEFAE0;
    font-size: 3rem;
}

.store-header-info {
    flex: 1;
}

.store-category {
    display: inline-block;
    background: #FEFAE0;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    color: #283618;
    margin-top: 0.5rem;
}

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

.product-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
}

.product-card:hover {
    transform: translateY(-2px);
}

.product-image {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #FEFAE0;
}

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

.unavailable-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(220, 53, 69, 0.9);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
}

.product-info {
    padding: 1.5rem;
}

.product-name {
    font-size: 1.2rem;
    color: #283618;
    margin-bottom: 0.5rem;
}

.product-description {
    color: #606C38;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
}

.product-price {
    font-size: 1.3rem;
    font-weight: 700;
    color: #BC6C25;
}

.btn-whatsapp {
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.3s;
    white-space: nowrap;
}

.btn-whatsapp:hover {
    opacity: 0.9;
}

/* Loading & Empty States */
.loading-container {
    text-align: center;
    padding: 4rem 2rem;
}

.spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto 1rem;
    border: 4px solid #FEFAE0;
    border-top-color: #BC6C25;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.empty-state h3 {
    color: #283618;
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: #606C38;
}

/* Responsive */
@media (max-width: 768px) {
    .page-title {
        font-size: 1.5rem;
    }

    .stores-grid,
    .products-grid {
        grid-template-columns: 1fr;
    }

    .store-header {
        flex-direction: column;
        text-align: center;
    }

    .product-footer {
        flex-direction: column;
        gap: 0.75rem;
    }

    .btn-whatsapp {
        width: 100%;
    }
}


/* ==================== DASHBOARD PRODUCTS MANAGEMENT ==================== */

/* Tabs */
.shop-admin-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--olive-green);
}

.tab-button {
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--dark-olive);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-button:hover {
    background: rgba(96, 108, 56, 0.05);
}

.tab-button.active {
    color: var(--copper);
    border-bottom-color: var(--copper);
    background: rgba(188, 108, 37, 0.05);
}

/* Products Management Section */
.products-management-section {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.products-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--cream);
}

.products-header h3 {
    color: var(--dark-olive);
    margin: 0;
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.product-card {
    background: white;
    border: 2px solid var(--cream);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    border-color: var(--olive-green);
    box-shadow: 0 4px 12px rgba(96, 108, 56, 0.15);
    transform: translateY(-2px);
}

.product-card.unavailable {
    opacity: 0.6;
}

.product-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.product-no-image {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, var(--cream), #f5f0e8);
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-no-image .placeholder-icon {
    font-size: 4rem;
    opacity: 0.5;
}

.product-info {
    padding: 1rem;
    flex: 1;
}

.product-info h5 {
    margin: 0 0 0.5rem 0;
    color: var(--dark-olive);
    font-size: 1.1rem;
}

.product-description {
    color: #666;
    font-size: 0.9rem;
    margin: 0.5rem 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price {
    font-size: 1.25rem;
    font-weight: bold;
    color: var(--copper);
    margin: 0.75rem 0;
}

.product-status {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.product-actions {
    padding: 1rem;
    display: flex;
    gap: 0.5rem;
    border-top: 1px solid var(--cream);
}

.product-actions .btn {
    flex: 1;
}

/* Product Modal */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-dialog {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow: hidden;
    z-index: 1001;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.modal-content {
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}

.modal-header {
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, var(--dark-olive), var(--olive-green));
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: white;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.close-btn:hover {
    background: rgba(255,255,255,0.2);
}

.modal-body {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 1.5rem 2rem;
    background: var(--cream);
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

/* Form Groups */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--dark-olive);
    font-weight: 500;
}

.form-group .text-danger {
    color: #dc3545;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--cream);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--olive-green);
}

.form-text {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: #666;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 1.25rem;
    height: 1.25rem;
    cursor: pointer;
}

/* Responsive Design */
@media (max-width: 768px) {
    .shop-admin-tabs {
        flex-direction: column;
    }

    .tab-button {
        width: 100%;
        text-align: right;
    }

    .products-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

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

    .modal-dialog {
        width: 95%;
        max-height: 95vh;
    }

    .modal-body {
        padding: 1rem;
    }

    .modal-footer {
        flex-direction: column;
    }

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