/* ========================================
   Store Theme - Default
   Bootstrap 5 based storefront styles
   ======================================== */

:root {
    --store-primary: var(--theme-primary, #4680FF);
    --store-secondary: var(--theme-secondary, #6c757d);
    --store-bg: #f8f9fa;
    --store-text: #212529;
    --store-muted: #6c757d;
    --store-border: #dee2e6;
    --store-radius: 0.5rem;
    --store-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --store-shadow-lg: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
}

/* ---- General ---- */
body {
    background-color: var(--store-bg);
    color: var(--store-text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

a {
    color: var(--store-primary);
    text-decoration: none;
}

a:hover {
    color: var(--store-primary);
    opacity: 0.85;
}

/* ---- Navbar ---- */
.store-navbar {
    background: #fff;
    box-shadow: var(--store-shadow);
    padding: 0.75rem 0;
}

.store-navbar .navbar-brand {
    font-weight: 700;
    font-size: 1.4rem;
    color: var(--store-primary);
}

.store-navbar .navbar-brand img {
    max-height: 40px;
}

.store-navbar .nav-link {
    color: var(--store-text);
    font-weight: 500;
    padding: 0.5rem 1rem;
}

.store-navbar .nav-link:hover,
.store-navbar .nav-link.active {
    color: var(--store-primary);
}

.store-search-form {
    max-width: 400px;
}

.store-search-form .form-control {
    border-radius: var(--store-radius) 0 0 var(--store-radius);
    border-right: none;
}

.store-search-form .btn {
    border-radius: 0 var(--store-radius) var(--store-radius) 0;
}

.cart-badge {
    position: relative;
}

.cart-badge .badge {
    position: absolute;
    top: -5px;
    right: -10px;
    font-size: 0.65rem;
    padding: 0.25em 0.5em;
}

/* ---- Hero Section ---- */
.store-hero {
    background: linear-gradient(135deg, var(--store-primary) 0%, #1a3a8f 100%);
    color: #fff;
    padding: 4rem 0;
    margin-bottom: 2rem;
}

.store-hero h1 {
    font-weight: 800;
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.store-hero p {
    font-size: 1.15rem;
    opacity: 0.9;
    margin-bottom: 1.5rem;
}

.store-hero .btn {
    padding: 0.6rem 2rem;
    font-weight: 600;
}

/* ---- Section Titles ---- */
.section-title {
    font-weight: 700;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    position: relative;
    padding-bottom: 0.5rem;
}

.section-title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 50px;
    height: 3px;
    background: var(--store-primary);
    border-radius: 2px;
}

.section-title.text-center::after {
    left: 50%;
    transform: translateX(-50%);
}

/* ---- Product Card ---- */
.product-card {
    background: #fff;
    border: 1px solid var(--store-border);
    border-radius: var(--store-radius);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--store-shadow-lg);
}

.product-card .product-image {
    position: relative;
    padding-top: 100%;
    background: #f1f3f5;
    overflow: hidden;
}

.product-card .product-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-card .product-image .placeholder-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3rem;
    color: #adb5bd;
}

.product-card .badge-featured {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 1;
}

.product-card .badge-out-of-stock {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1;
}

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

.product-card .product-category {
    font-size: 0.8rem;
    color: var(--store-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.product-card .product-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--store-text);
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card .product-name a {
    color: inherit;
}

.product-card .product-name a:hover {
    color: var(--store-primary);
}

.product-card .product-price {
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--store-primary);
}

.product-card .product-price .compare-price {
    font-weight: 400;
    font-size: 0.85rem;
    color: var(--store-muted);
    text-decoration: line-through;
    margin-left: 0.5rem;
}

.product-card .btn-add-cart {
    width: 100%;
    margin-top: 0.75rem;
}

/* ---- Category Card ---- */
.category-card {
    background: #fff;
    border: 1px solid var(--store-border);
    border-radius: var(--store-radius);
    padding: 1.5rem;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
    height: 100%;
}

.category-card:hover {
    transform: translateY(-4px) scale(1.03);
    box-shadow: var(--store-shadow-lg);
    border-color: var(--store-primary);
}

.category-card .category-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--store-primary), #1a3a8f);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 2rem;
}

.category-card .category-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.category-card h5 {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.category-card .product-count {
    color: var(--store-muted);
    font-size: 0.85rem;
}

/* ---- Product Detail ---- */
.product-detail-images {
    background: #fff;
    border-radius: var(--store-radius);
    padding: 1rem;
    border: 1px solid var(--store-border);
}

.product-detail-images .main-image {
    width: 100%;
    aspect-ratio: 1;
    object-fit: contain;
    background: #f8f9fa;
    border-radius: var(--store-radius);
}

.product-detail-images .thumbnail-list {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    overflow-x: auto;
}

.product-detail-images .thumbnail-list img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border: 2px solid var(--store-border);
    border-radius: 0.25rem;
    cursor: pointer;
}

.product-detail-images .thumbnail-list img.active,
.product-detail-images .thumbnail-list img:hover {
    border-color: var(--store-primary);
}

.product-detail-info {
    background: #fff;
    border-radius: var(--store-radius);
    padding: 1.5rem;
    border: 1px solid var(--store-border);
}

.product-detail-info .product-title {
    font-weight: 700;
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.product-detail-info .product-sku {
    color: var(--store-muted);
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

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

.product-detail-info .product-price-lg .compare-price {
    font-size: 1.2rem;
    font-weight: 400;
    color: var(--store-muted);
    text-decoration: line-through;
}

.product-detail-info .stock-badge {
    margin-bottom: 1.5rem;
}

.product-detail-info .quantity-input {
    max-width: 120px;
}

.product-detail-info .product-description {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--store-border);
    line-height: 1.7;
}

/* ---- Cart ---- */
.cart-table {
    background: #fff;
    border-radius: var(--store-radius);
    border: 1px solid var(--store-border);
    overflow: hidden;
}

.cart-table th {
    background: #f8f9fa;
    font-weight: 600;
    border-bottom: 2px solid var(--store-border);
}

.cart-table .cart-item-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 0.25rem;
}

.cart-table .cart-item-image-placeholder {
    width: 60px;
    height: 60px;
    background: #f1f3f5;
    border-radius: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #adb5bd;
}

.cart-table .quantity-input {
    width: 80px;
}

.cart-summary {
    background: #fff;
    border: 1px solid var(--store-border);
    border-radius: var(--store-radius);
    padding: 1.5rem;
}

.cart-summary h5 {
    font-weight: 700;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--store-border);
}

.cart-summary .summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.cart-summary .summary-total {
    font-size: 1.25rem;
    font-weight: 700;
    padding-top: 0.75rem;
    margin-top: 0.75rem;
    border-top: 2px solid var(--store-border);
}

/* ---- Checkout ---- */
.checkout-section {
    background: #fff;
    border: 1px solid var(--store-border);
    border-radius: var(--store-radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.checkout-section h5 {
    font-weight: 700;
    margin-bottom: 1rem;
}

/* ---- Account ---- */
.account-sidebar {
    background: #fff;
    border: 1px solid var(--store-border);
    border-radius: var(--store-radius);
    overflow: hidden;
}

.account-sidebar .list-group-item {
    border-left: none;
    border-right: none;
    padding: 0.75rem 1.25rem;
    font-weight: 500;
}

.account-sidebar .list-group-item:first-child {
    border-top: none;
}

.account-sidebar .list-group-item.active {
    background-color: var(--store-primary);
    border-color: var(--store-primary);
}

.account-content {
    background: #fff;
    border: 1px solid var(--store-border);
    border-radius: var(--store-radius);
    padding: 1.5rem;
}

.stat-card {
    background: #fff;
    border: 1px solid var(--store-border);
    border-radius: var(--store-radius);
    padding: 1.25rem;
    text-align: center;
}

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--store-primary);
}

.stat-card .stat-label {
    font-size: 0.85rem;
    color: var(--store-muted);
}

/* ---- Auth Pages ---- */
.auth-container {
    max-width: 480px;
    margin: 3rem auto;
}

.auth-card {
    background: #fff;
    border: 1px solid var(--store-border);
    border-radius: var(--store-radius);
    padding: 2rem;
    box-shadow: var(--store-shadow);
}

.auth-card .auth-title {
    font-weight: 700;
    font-size: 1.5rem;
    text-align: center;
    margin-bottom: 1.5rem;
}

.auth-card .auth-logo {
    text-align: center;
    margin-bottom: 1.5rem;
}

.auth-card .auth-logo img {
    max-height: 50px;
}

/* ---- Order Status Badges ---- */
.badge-pending { background-color: #ffc107; color: #212529; }
.badge-confirmed { background-color: #17a2b8; }
.badge-processing { background-color: #4680FF; }
.badge-shipped { background-color: #6f42c1; }
.badge-delivered { background-color: #28a745; }
.badge-cancelled { background-color: #dc3545; }
.badge-refunded { background-color: #6c757d; }

/* ---- Footer ---- */
.store-footer {
    background: #212529;
    color: #adb5bd;
    padding: 3rem 0 1.5rem;
    margin-top: 3rem;
}

.store-footer h5 {
    color: #fff;
    font-weight: 600;
    margin-bottom: 1rem;
}

.store-footer a {
    color: #adb5bd;
}

.store-footer a:hover {
    color: #fff;
}

.store-footer .footer-bottom {
    border-top: 1px solid #495057;
    padding-top: 1rem;
    margin-top: 2rem;
    font-size: 0.85rem;
}

/* ---- Pagination ---- */
.store-pagination .page-link {
    color: var(--store-primary);
    border-radius: var(--store-radius);
    margin: 0 2px;
}

.store-pagination .page-item.active .page-link {
    background-color: var(--store-primary);
    border-color: var(--store-primary);
}

/* ---- Empty State ---- */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
}

.empty-state .empty-icon {
    font-size: 4rem;
    color: #dee2e6;
    margin-bottom: 1rem;
}

.empty-state h4 {
    font-weight: 600;
    color: var(--store-muted);
}

.empty-state p {
    color: var(--store-muted);
    margin-bottom: 1.5rem;
}

/* ---- Sidebar Filters ---- */
.filter-sidebar {
    background: #fff;
    border: 1px solid var(--store-border);
    border-radius: var(--store-radius);
    padding: 1.25rem;
}

.filter-sidebar h6 {
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.filter-sidebar .list-group-item {
    border: none;
    padding: 0.4rem 0;
}

/* ---- Utilities ---- */
.btn-primary {
    background-color: var(--store-primary);
    border-color: var(--store-primary);
}

.btn-primary:hover {
    background-color: var(--store-primary);
    border-color: var(--store-primary);
    opacity: 0.9;
}

.btn-outline-primary {
    color: var(--store-primary);
    border-color: var(--store-primary);
}

.btn-outline-primary:hover {
    background-color: var(--store-primary);
    border-color: var(--store-primary);
}

.text-primary {
    color: var(--store-primary) !important;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .store-hero h1 {
        font-size: 1.75rem;
    }

    .store-hero {
        padding: 2.5rem 0;
    }

    .product-detail-info .product-title {
        font-size: 1.35rem;
    }

    .product-detail-info .product-price-lg {
        font-size: 1.5rem;
    }
}

/* Star Rating Input */
.star-rating-input {
    display: inline-flex;
    flex-direction: row-reverse;
    gap: 2px;
}
.star-rating-input input { display: none; }
.star-rating-input label {
    cursor: pointer;
    font-size: 1.5rem;
    color: #dee2e6;
    transition: color 0.15s;
}
.star-rating-input input:checked ~ label,
.star-rating-input label:hover,
.star-rating-input label:hover ~ label {
    color: #ffc107;
}

/* ---- Product Zoom ---- */
.product-zoom-container {
    overflow: hidden;
    cursor: crosshair;
}

.product-zoom-container img {
    transition: transform 0.3s ease;
}

.product-zoom-container:hover img {
    transform: scale(2);
}

/* ---- Sticky Add to Cart ---- */
.sticky-add-to-cart {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1040;
    background: #fff;
    border-top: 1px solid #dee2e6;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.sticky-add-to-cart.visible {
    transform: translateY(0);
}

@media (max-width: 767.98px) {
    .product-zoom-container:hover img {
        transform: none;
    }

    .product-zoom-container {
        cursor: default;
    }
}

/* ---- View Toggle ---- */
.view-toggle .btn {
    padding: 0.375rem 0.5rem;
}

.view-toggle .btn.active {
    color: var(--store-primary);
    border-color: var(--store-primary);
}

/* ---- List View ---- */
.list-view .col-product {
    flex: 0 0 100%;
    max-width: 100%;
}

.list-view .product-card {
    flex-direction: row;
}

.list-view .product-card .product-image {
    width: 200px;
    min-width: 200px;
    padding-top: 0;
    height: 200px;
}

.list-view .product-card .product-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.list-view .product-card .product-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1;
}

.list-view .product-card .product-description-excerpt {
    display: block !important;
}

.list-view .product-card .btn-add-cart {
    width: auto;
    align-self: flex-start;
}

@media (max-width: 576px) {
    .list-view .product-card {
        flex-direction: column;
    }

    .list-view .product-card .product-image {
        width: 100%;
        min-width: 100%;
        padding-top: 60%;
        height: auto;
    }
}

/* ---- Quick View Button ---- */
.product-card .quick-view-btn {
    position: absolute;
    bottom: 10px;
    right: 10px;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 2;
    width: 32px;
    height: 32px;
    padding: 0;
    line-height: 32px;
}

.product-card:hover .quick-view-btn {
    opacity: 1;
}

/* ---- Quick View Modal ---- */
.quickview-modal .modal-dialog {
    max-width: 800px;
}

.quickview-modal .quickview-image img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    background: #f8f9fa;
}

/* ---- Cart Offcanvas ---- */
#cartOffcanvas { width: 400px; }
#cartOffcanvas .offcanvas-body { padding: 0; }
.cart-offcanvas-items { padding: 1rem; }
.cart-offcanvas-item { display: flex; gap: 0.75rem; padding: 0.75rem 0; border-bottom: 1px solid #f0f0f0; }
.cart-offcanvas-item:last-child { border-bottom: none; }
.cart-offcanvas-item img { width: 60px; height: 60px; object-fit: cover; border-radius: 6px; flex-shrink: 0; }
.cart-offcanvas-item .item-img-placeholder { width: 60px; height: 60px; border-radius: 6px; flex-shrink: 0; background: #f1f3f5; display: flex; align-items: center; justify-content: center; color: #adb5bd; font-size: 1.5rem; }
.cart-offcanvas-item .item-info { flex: 1; min-width: 0; }
.cart-offcanvas-item .item-name { font-weight: 600; font-size: 0.875rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cart-offcanvas-item .item-name a { color: inherit; text-decoration: none; }
.cart-offcanvas-item .item-name a:hover { color: var(--theme-primary); }
.cart-offcanvas-item .item-variant { font-size: 0.75rem; color: #6c757d; }
.cart-offcanvas-item .item-price { font-weight: 600; color: var(--theme-primary); font-size: 0.875rem; }
.cart-offcanvas-item .item-qty { display: flex; align-items: center; gap: 0.25rem; margin-top: 0.25rem; }
.cart-offcanvas-item .item-qty button { width: 26px; height: 26px; padding: 0; font-size: 0.75rem; border-radius: 4px; }
.cart-offcanvas-item .item-qty input { width: 36px; height: 26px; text-align: center; font-size: 0.8rem; border: 1px solid #dee2e6; border-radius: 4px; }
.cart-offcanvas-item .item-remove { background: none; border: none; color: #adb5bd; padding: 0.25rem; font-size: 1rem; line-height: 1; cursor: pointer; transition: color 0.15s; flex-shrink: 0; align-self: flex-start; }
.cart-offcanvas-item .item-remove:hover { color: #dc3545; }
.cart-offcanvas-footer { padding: 1rem; border-top: 1px solid #dee2e6; background: #f8f9fa; }
@media (max-width: 575.98px) { #cartOffcanvas { width: 100%; } }

/* Content Block */
.ui-block--content_block .content-row { margin-bottom: 3rem; }
.ui-block--content_block .content-row:last-child { margin-bottom: 0; }
.ui-block--content_block .content-image img { width: 100%; height: auto; }
.ui-block--content_block .content-text h3 { margin-bottom: 1rem; }
.ui-block--content_block .content-text p { line-height: 1.8; }
.ui-block--content_block .content-text-body { line-height: 1.8; }
.ui-block--content_block .content-text-body p { margin-bottom: 1rem; }
