/* Store Specific Styles */

:root {
    --primary-color: #2563eb;
    --dark-color: #1e293b;
    --light-color: #f9fafb;
    --border-color: #e2e8f0;
    --surface-color: rgba(255, 255, 255, 0.9);
    --surface-border: rgba(226, 232, 240, 0.95);
}

body {
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.08), transparent 34%),
        radial-gradient(circle at top right, rgba(14, 165, 233, 0.08), transparent 28%),
        linear-gradient(180deg, #f8fbff 0%, #f4f8fc 58%, #eef4fb 100%);
}

/* Store Container */
.store-container {
    min-height: calc(100vh - 80px);
    padding-top: 80px;
    position: relative;
    isolation: isolate;
}

.store-container > section {
    position: relative;
    z-index: 1;
}

.store-header {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle at 12% 18%, rgba(96, 165, 250, 0.34), transparent 26%),
        radial-gradient(circle at 85% 8%, rgba(255, 255, 255, 0.16), transparent 22%),
        linear-gradient(135deg, #0f4fd8 0%, #2563eb 46%, #1d4ed8 100%);
    color: white;
    padding: 72px 0 78px !important;
    box-shadow: 0 22px 50px rgba(37, 99, 235, 0.18);
    border-radius: 0 0 32px 32px;
}

.store-header::before,
.store-header::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    filter: blur(4px);
}

.store-header::before {
    width: 240px;
    height: 240px;
    right: -60px;
    top: -80px;
    background: rgba(255, 255, 255, 0.08);
}

.store-header::after {
    width: 180px;
    height: 180px;
    left: -40px;
    bottom: -80px;
    background: rgba(255, 255, 255, 0.07);
}

.store-header .container {
    position: relative;
    z-index: 1;
    max-width: 1140px;
}

.store-header h1 {
    color: white;
    letter-spacing: -0.03em;
    text-shadow: 0 10px 30px rgba(15, 23, 42, 0.16);
}

.store-header .lead {
    color: rgba(255, 255, 255, 0.88);
    max-width: 560px;
}

#storeClosedBanner {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #78350f;
    border: none;
    font-weight: 600;
    letter-spacing: 0.01em;
    box-shadow: 0 14px 32px rgba(120, 53, 15, 0.12);
    margin-top: 100px !important;
}

#storeClosedBanner.d-none {
    display: none !important;
}

/* Search & Filter */
.store-container > section.py-4.border-bottom {
    border-bottom: none !important;
    padding-top: 0 !important;
    margin-top: -26px;
}

.store-container > section.py-4.border-bottom .container,
.store-container > section.py-5 .container {
    background: var(--surface-color);
    border: 1px solid var(--surface-border);
    border-radius: 28px;
    box-shadow: 0 28px 70px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.store-container > section.py-4.border-bottom .container {
    padding: 1.35rem;
}

.store-container > section.py-5 {
    padding-top: 2.25rem !important;
}

.store-container > section.py-5 .container {
    padding: 1.75rem 1.75rem 1.5rem;
}

.input-group {
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
    border-radius: 16px;
    overflow: hidden;
}

.input-group-text {
    background: #ffffff;
    color: #64748b;
    border-color: var(--border-color);
}

.form-select,
.form-control {
    border-color: var(--border-color);
    padding: 0.85rem 1rem;
    min-height: 52px;
    border-radius: 14px;
    background-color: #ffffff;
    color: var(--dark-color);
}

.form-control::placeholder {
    color: #94a3b8;
}

.form-select:focus,
.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(37, 99, 235, 0.12);
}

.form-select {
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

/* Product Card */
.row.g-4 {
    --bs-gutter-x: 1.25rem;
    --bs-gutter-y: 1.25rem;
}

#productsContainer {
    margin-top: 0.5rem;
}

#loadingSpinner {
    padding: 2rem 0 1rem;
}

.spinner-border {
    width: 3rem;
    height: 3rem;
    color: var(--primary-color) !important;
}

.product-card {
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 22px;
    overflow: hidden;
    transition: transform 0.26s ease, box-shadow 0.26s ease, border-color 0.26s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.98));
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.06);
}

.product-card:hover {
    box-shadow: 0 24px 56px rgba(15, 23, 42, 0.14);
    transform: translateY(-6px);
    border-color: rgba(37, 99, 235, 0.35);
}

.product-image {
    width: 100%;
    aspect-ratio: 4 / 3;
    min-height: 190px;
    background:
        radial-gradient(circle at center, rgba(255, 255, 255, 0.75), rgba(226, 232, 240, 0.92)),
        linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    position: relative;
    isolation: isolate;
}

.product-image::after {
    content: '';
    position: absolute;
    inset: auto 12px 12px;
    height: 28px;
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.08), transparent);
    filter: blur(18px);
    z-index: -1;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
    transition: transform 0.3s ease;
}

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

.product-image.no-image {
    color: #94a3b8;
    font-size: 2.55rem;
}

.product-info {
    padding: 1rem 1rem 1.1rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-name {
    font-weight: 700;
    font-size: 1rem;
    color: var(--dark-color);
    margin-bottom: 0.45rem;
    line-height: 1.28;
    flex-grow: 1;
    letter-spacing: -0.01em;
}

.product-sku {
    font-size: 0.72rem;
    color: #94a3b8;
    margin-bottom: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.product-price {
    font-size: 1.18rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 0.6rem;
}

.product-stock {
    font-size: 0.76rem;
    margin-bottom: 0.8rem;
    display: inline-flex;
    align-self: flex-start;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    background: #f8fafc;
    border: 1px solid rgba(226, 232, 240, 0.95);
}

.product-stock.in-stock {
    color: #047857;
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.2);
}

.product-stock.low-stock {
    color: #b45309;
    background: rgba(245, 158, 11, 0.13);
    border-color: rgba(245, 158, 11, 0.22);
}

.product-stock.out-of-stock {
    color: #b91c1c;
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.22);
}

.product-actions {
    display: flex;
    gap: 0.4rem;
    margin-top: auto;
}

.btn-add-cart {
    flex: 1;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: white;
    border: none;
    padding: 0.7rem 0.75rem;
    border-radius: 12px;
    font-size: 0.82rem;
    font-weight: 700;
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
    box-shadow: 0 10px 18px rgba(37, 99, 235, 0.18);
}

.btn-add-cart:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 14px 24px rgba(37, 99, 235, 0.24);
}

.btn-add-cart:disabled {
    background: #cbd5e1;
    cursor: not-allowed;
    box-shadow: none;
}

.btn-view-detail {
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    color: var(--dark-color);
    padding: 0.7rem 0.75rem;
    border-radius: 12px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.btn-view-detail:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.08);
}

#pageInfo {
    color: #64748b;
    font-size: 0.92rem;
    letter-spacing: 0.01em;
}

#prevPageBtn,
#nextPageBtn {
    padding: 0.85rem 1.4rem;
    border-radius: 999px;
    font-weight: 700;
    box-shadow: 0 10px 18px rgba(15, 23, 42, 0.05);
}

#prevPageBtn:hover,
#nextPageBtn:hover {
    transform: translateY(-1px);
}

#noProducts {
    color: #64748b;
}

#noProducts h4 {
    color: var(--dark-color);
    font-weight: 700;
}

/* Product Detail Modal */
.modal-content {
    border: 0;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(15, 23, 42, 0.22);
}

.modal-header {
    border-color: var(--border-color);
    padding: 1.25rem 1.5rem;
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.95), rgba(255, 255, 255, 0.98));
}

.modal-body {
    padding: 1.8rem;
}

.detail-image {
    width: 100%;
    border-radius: 18px;
    margin-bottom: 1.25rem;
    object-fit: cover;
    max-height: 400px;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

.detail-info h2 {
    color: var(--dark-color);
    margin-bottom: 0.9rem;
    letter-spacing: -0.02em;
}

.detail-price {
    font-size: 2rem;
    color: var(--primary-color);
    font-weight: 800;
    margin-bottom: 1rem;
}

.detail-stock {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.detail-actions {
    display: flex;
    gap: 1rem;
}

.detail-actions button {
    flex: 1;
    padding: 0.85rem 1.25rem;
    border-radius: 12px;
    border: none;
    font-weight: 700;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.detail-actions button:hover {
    transform: translateY(-1px);
}

.detail-actions .btn-primary {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: white;
    box-shadow: 0 12px 24px rgba(37, 99, 235, 0.18);
}

.detail-actions .btn-primary:hover {
    box-shadow: 0 16px 28px rgba(37, 99, 235, 0.24);
}

.detail-actions .btn-secondary {
    background: #f1f5f9;
    color: var(--dark-color);
}

/* Cart Page */
.cart-container {
    background: var(--light-color);
}

.cart-item {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.4rem;
    margin-bottom: 1rem;
    display: flex;
    gap: 1.25rem;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.05);
}

.cart-item-image {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 12px;
    background: var(--light-color);
    overflow: hidden;
}

.cart-item-details {
    flex: 1;
}

.cart-item-name {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

.cart-item-price {
    color: var(--primary-color);
    font-weight: 700;
    margin-bottom: 1rem;
}

.cart-item-quantity {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.btn-quantity {
    width: 34px;
    height: 34px;
    border: 1px solid var(--border-color);
    background: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-quantity:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.quantity-input {
    width: 64px;
    text-align: center;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.25rem 0.5rem;
}

.btn-remove {
    background: none;
    border: none;
    color: #dc2626;
    cursor: pointer;
    font-size: 0.9rem;
}

.btn-remove:hover {
    text-decoration: underline;
}

/* Account Nav */
.navbar .account-nav-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: 38px;
    padding: 0.35rem 0.75rem !important;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: #ffffff;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.navbar .account-nav-button:hover,
.navbar .account-nav-button.active {
    border-color: rgba(37, 99, 235, 0.45);
    box-shadow: 0 8px 22px rgba(37, 99, 235, 0.14);
    transform: translateY(-1px);
}

.account-nav-icon {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--dark-color);
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
}

.account-nav-button.is-signed-in .account-nav-icon {
    background: var(--primary-color);
}

.account-nav-label {
    color: var(--dark-color);
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1;
}

/* Account Page */
.account-container {
    background: var(--light-color);
}

.account-panel,
.account-stat,
.order-card,
.account-empty {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 14px;
}

.account-panel {
    padding: 1.5rem;
}

.account-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex: 0 0 auto;
}

.account-stat {
    padding: 1rem;
    min-height: 92px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.account-stat span {
    color: var(--primary-color);
    font-size: 1.35rem;
    font-weight: 700;
}

.account-stat small {
    color: #64748b;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0;
}

.account-tabs .nav-link {
    color: var(--dark-color);
    font-weight: 600;
}

.order-card {
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.order-status {
    align-self: flex-start;
    border-radius: 999px;
    padding: 0.35rem 0.75rem;
    font-size: 0.78rem;
    font-weight: 700;
}

.status-progress {
    background: #fef3c7;
    color: #92400e;
}

.status-completed {
    background: #dcfce7;
    color: #166534;
}

.status-cancelled {
    background: #fee2e2;
    color: #991b1b;
}

.order-items {
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 0;
}

.order-item-row,
.order-total {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.45rem;
}

.order-item-row:last-child {
    margin-bottom: 0;
}

.order-total {
    margin-top: 0.85rem;
    margin-bottom: 0;
    color: var(--dark-color);
}

.account-empty {
    text-align: center;
    padding: 2rem;
    color: #64748b;
}

.account-empty i {
    font-size: 2.4rem;
    margin-bottom: 0.75rem;
}

/* Paginación */
#prevPageBtn,
#nextPageBtn {
    padding: 0.85rem 1.4rem;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 999px;
    transition: all 0.2s ease;
}

#prevPageBtn:hover,
#nextPageBtn:hover {
    transform: translateY(-1px);
}

#pageInfo {
    color: #64748b;
    font-size: 0.92rem;
    letter-spacing: 0.01em;
    margin-top: 20px;
}

/* Responsive */
@media (max-width: 768px) {
    .store-header {
        padding: 46px 0 52px !important;
        border-radius: 0 0 24px 24px;
    }

    .store-header h1 {
        font-size: 2rem;
    }

    .store-header .lead {
        font-size: 1rem;
    }

    .store-container > section.py-4.border-bottom {
        margin-top: -18px;
    }

    .store-container > section.py-4.border-bottom .container,
    .store-container > section.py-5 .container {
        border-radius: 22px;
    }

    .store-container > section.py-5 .container {
        padding: 1.1rem;
    }

    .product-card {
        margin-bottom: 0.65rem;
        border-radius: 16px;
    }

    .product-image {
        aspect-ratio: 1 / 1;
        min-height: 130px;
        padding: 8px;
    }

    .product-image.no-image {
        font-size: 1.6rem;
    }

    .product-info {
        padding: 0.8rem;
    }

    .product-name {
        font-size: 0.88rem;
        line-height: 1.25;
        margin-bottom: 0.35rem;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .product-sku {
        font-size: 0.68rem;
        margin-bottom: 0.35rem;
    }

    .product-price {
        font-size: 1rem;
        margin-bottom: 0.35rem;
    }

    .product-stock {
        font-size: 0.68rem;
        margin-bottom: 0.5rem;
    }

    .btn-add-cart,
    .btn-view-detail {
        min-height: 32px;
        font-size: 0.73rem;
        padding: 0.35rem;
    }

    .detail-actions {
        flex-direction: column;
    }

    .cart-item {
        flex-direction: column;
    }

    .cart-item-image {
        width: 100%;
    }

    #prevPageBtn,
    #nextPageBtn {
        padding: 10px 14px;
        min-width: 140px;
    }

    #pageInfo {
        font-size: 0.86rem;
        margin-top: 10px;
    }

    .navbar .account-nav-button {
        width: 100%;
        justify-content: center;
        margin-top: 0.4rem;
    }
}

@media (max-width: 480px) {
    .store-header h1 {
        font-size: 1.75rem;
    }

    .store-header .lead {
        font-size: 0.98rem;
    }

    #productsContainer {
        --bs-gutter-x: 0.6rem;
        --bs-gutter-y: 0.6rem;
    }

    .product-card {
        margin-bottom: 0.4rem;
    }

    .product-info {
        padding: 0.65rem;
    }

    .product-name {
        font-size: 0.8rem;
    }

    .product-price {
        font-size: 0.95rem;
    }

    .product-image {
        min-height: 115px;
    }

    .btn-add-cart,
    .btn-view-detail {
        min-height: 30px;
        font-size: 0.7rem;
    }

    #prevPageBtn,
    #nextPageBtn {
        min-width: 0;
        width: 48%;
        padding: 9px 10px;
        font-size: 0.9rem;
    }
}
