/* ============================================
   Shop — Clean Contained E-Commerce Theme
   Inspired by ShopGrids, Start Bootstrap Shop,
   and Shopify starter themes
   ============================================ */

:root {
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --accent-light: rgba(37, 99, 235, 0.08);
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --bg-page: #eef0f3;
    --bg-card: #ffffff;
    --bg-header: #ffffff;
    --border: #e5e7eb;
    --border-light: #f3f4f6;
    --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.05), 0 2px 4px rgba(0,0,0,0.04);
    --shadow-lg: 0 10px 20px rgba(0,0,0,0.06), 0 4px 8px rgba(0,0,0,0.04);
    --shadow-frame: 0 0 0 1px rgba(0,0,0,0.05), 0 1px 8px rgba(0,0,0,0.06);
    --radius: 6px;
    --radius-lg: 8px;
    --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --price-color: #2563eb;
    --success: #059669;
    --danger: #dc2626;
    --warning: #d97706;
    --frame-max: 1080px;
}

*, *::before, *::after {
    box-sizing: border-box;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    font-family: var(--font);
    color: var(--text-primary);
    background: var(--bg-page);
    line-height: 1.55;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    margin: 0;
    padding: 0;
}

/* ---- Outer Frame ---- */
/* The "page" container that floats on the background */
.site-frame {
    max-width: var(--frame-max);
    width: 100%;
    margin: 20px auto;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-frame);
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 40px);
    overflow: hidden;
}

@media (max-width: 1120px) {
    .site-frame {
        margin: 12px;
        border-radius: var(--radius);
    }
}

@media (max-width: 767px) {
    .site-frame {
        margin: 0;
        border-radius: 0;
        border-left: none;
        border-right: none;
        min-height: 100vh;
    }
}

main {
    flex: 1;
}

/* ---- Header / Navbar ---- */
.shop-navbar {
    background: var(--bg-header) !important;
    padding: 0;
    border-bottom: 1px solid var(--border);
}

.shop-navbar .navbar-inner {
    padding: 0.6rem 1.25rem;
}

.shop-navbar .navbar-brand {
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: -0.3px;
    color: var(--text-primary) !important;
}

.shop-navbar .navbar-brand:hover {
    color: var(--accent) !important;
}

.shop-navbar .nav-link {
    font-size: 0.82rem;
    font-weight: 500;
    padding: 0.4rem 0.65rem !important;
    color: var(--text-secondary) !important;
    transition: color 0.15s;
}

.shop-navbar .nav-link:hover {
    color: var(--accent) !important;
}

.shop-navbar .form-control {
    background: var(--border-light);
    border: 1px solid var(--border);
    color: var(--text-primary);
    font-size: 0.8rem;
    border-radius: var(--radius);
    padding: 0.3rem 0.65rem;
}

.shop-navbar .form-control::placeholder {
    color: var(--text-muted);
}

.shop-navbar .form-control:focus {
    background: #fff;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
    color: var(--text-primary);
}

.shop-navbar .btn-search {
    background: var(--accent);
    border: none;
    color: #fff;
    font-size: 0.8rem;
    font-weight: 500;
    padding: 0.3rem 0.75rem;
    border-radius: var(--radius);
    transition: background 0.15s;
}

.shop-navbar .btn-search:hover {
    background: var(--accent-hover);
}

.shop-navbar .btn-currency {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.2rem 0.5rem;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fff;
}

.shop-navbar .btn-currency:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.shop-navbar .btn-cart {
    background: #fff;
    border: 1px solid var(--border);
    color: var(--text-primary);
    font-size: 0.8rem;
    font-weight: 500;
    padding: 0.3rem 0.75rem;
    border-radius: var(--radius);
    transition: all 0.15s;
}

.shop-navbar .btn-cart:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.shop-navbar .navbar-toggler {
    border-color: var(--border);
    padding: 0.25rem 0.5rem;
    font-size: 0.85rem;
}

.shop-navbar .navbar-toggler-icon {
    filter: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(107, 114, 128, 1)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.cart-badge {
    font-size: 0.6rem;
    padding: 0.2em 0.45em;
    background: var(--accent) !important;
}

/* ---- Breadcrumbs ---- */
.shop-breadcrumb {
    background: #fafbfc;
    border-bottom: 1px solid var(--border);
    padding: 0;
}

.shop-breadcrumb .breadcrumb-inner {
    padding: 0 1.25rem;
}

.shop-breadcrumb .breadcrumb {
    margin: 0;
    padding: 0.4rem 0;
    font-size: 0.76rem;
}

.shop-breadcrumb .breadcrumb-item a {
    color: var(--accent);
    text-decoration: none;
}

.shop-breadcrumb .breadcrumb-item a:hover {
    text-decoration: underline;
}

.shop-breadcrumb .breadcrumb-item.active {
    color: var(--text-muted);
}

.shop-breadcrumb .breadcrumb-item + .breadcrumb-item::before {
    color: var(--text-muted);
}

/* ---- Main Content Area ---- */
.content-area {
    padding: 1.25rem;
}

/* ---- Hero ---- */
.shop-hero {
    padding: 1.5rem 0 1rem;
    text-align: center;
}

.shop-hero h1 {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.3px;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.shop-hero p {
    color: var(--text-secondary);
    font-size: 0.88rem;
    margin: 0;
}

/* ---- Category Pills ---- */
.category-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    padding: 0;
    list-style: none;
    margin: 0;
}

.category-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.75rem;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.15s;
}

.category-pill:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-light);
}

.category-pill .pill-count {
    font-size: 0.68rem;
    color: var(--text-muted);
    font-weight: 400;
}

/* ---- Product Cards ---- */
.product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.85rem;
}

@media (max-width: 991px) {
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
@media (max-width: 767px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 479px) {
    .product-grid {
        grid-template-columns: 1fr;
    }
}

.product-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    transition: box-shadow 0.2s, border-color 0.2s;
    text-decoration: none;
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    border-color: #d1d5db;
    box-shadow: var(--shadow-md);
    color: var(--text-primary);
}

.product-card .card-img-wrap {
    position: relative;
    overflow: hidden;
    background: #f9fafb;
    border-bottom: 1px solid var(--border-light);
}

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

.product-card:hover .card-img-top {
    transform: scale(1.03);
}

.product-card .card-img-placeholder {
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    color: var(--text-muted);
    font-size: 0.78rem;
}

.product-card .card-info {
    padding: 0.65rem 0.75rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-card .card-title {
    font-size: 0.82rem;
    font-weight: 600;
    margin: 0 0 0.3rem;
    line-height: 1.35;
    color: var(--text-primary);
}

.product-card .card-price {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--price-color);
    margin-top: auto;
}

/* ---- Badges ---- */
.badge-stock {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.15em 0.5em;
    border-radius: var(--radius);
}

.badge-out {
    background: rgba(220, 38, 38, 0.08);
    color: var(--danger);
}

.badge-low {
    background: rgba(217, 119, 6, 0.1);
    color: var(--warning);
}

.badge-instock {
    color: var(--success);
}

/* ---- Product Detail ---- */
.product-gallery-main {
    max-height: 450px;
    object-fit: contain;
    width: 100%;
    border-radius: var(--radius);
    background: #f9fafb;
    border: 1px solid var(--border);
}

.product-gallery-thumb {
    width: 60px;
    height: 60px;
    object-fit: cover;
    cursor: pointer;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    transition: border-color 0.15s, opacity 0.15s;
    opacity: 0.65;
}

.product-gallery-thumb:hover,
.product-gallery-thumb.active {
    border-color: var(--accent);
    opacity: 1;
}

.product-detail-title {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.2px;
    color: var(--text-primary);
}

.product-detail-price {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--price-color);
}

.btn-add-cart {
    background: var(--accent);
    border: none;
    color: #fff;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.5rem 1.5rem;
    border-radius: var(--radius);
    transition: background 0.15s;
}

.btn-add-cart:hover {
    background: var(--accent-hover);
    color: #fff;
}

.product-description h2 {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.product-description .desc-text {
    font-size: 0.87rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

.no-image-placeholder {
    height: 360px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ---- Sidebar ---- */
.category-sidebar-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.category-sidebar-box .sidebar-title {
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0.65rem 0.85rem;
    margin: 0;
    background: #f9fafb;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border);
}

.category-sidebar-box .list-group-item {
    font-size: 0.8rem;
    padding: 0.45rem 0.85rem;
    border: none;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-secondary);
    transition: all 0.1s;
}

.category-sidebar-box .list-group-item:last-child {
    border-bottom: none;
}

.category-sidebar-box .list-group-item:hover {
    background: var(--accent-light);
    color: var(--accent);
}

.category-sidebar-box .list-group-item.active {
    background: var(--accent-light);
    color: var(--accent);
    font-weight: 600;
}

/* ---- Sort Select ---- */
.sort-select {
    font-size: 0.76rem;
    padding: 0.22rem 0.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

/* ---- Pagination ---- */
.pagination-compact .page-link {
    font-size: 0.78rem;
    padding: 0.25rem 0.55rem;
    border-radius: var(--radius);
    margin: 0 1px;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.pagination-compact .page-item.active .page-link {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.pagination-compact .page-link:hover {
    background: var(--accent-light);
    color: var(--accent);
    border-color: var(--accent);
}

/* ---- Section Headings ---- */
.section-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.65rem;
    letter-spacing: -0.2px;
}

/* ---- Footer ---- */
.shop-footer {
    background: #f9fafb;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    padding: 0.65rem 1.25rem;
    font-size: 0.75rem;
    margin-top: auto;
}

.shop-footer a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.15s;
}

.shop-footer a:hover {
    color: var(--accent);
}

.shop-footer .footer-divider {
    color: var(--border);
    margin: 0 0.4rem;
}

.crypto-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.7rem;
    color: var(--text-muted);
    border: 1px solid var(--border);
    padding: 0.12rem 0.45rem;
    border-radius: var(--radius);
    background: #fff;
}

/* ---- Alerts ---- */
.alert {
    font-size: 0.82rem;
    border-radius: var(--radius);
    padding: 0.55rem 0.9rem;
}

/* ---- Search ---- */
.search-highlight {
    background: rgba(37, 99, 235, 0.1);
    padding: 0 2px;
    border-radius: 2px;
}

.search-heading {
    font-size: 1.05rem;
    font-weight: 700;
}

/* ---- 404 ---- */
.page-404 {
    text-align: center;
    padding: 3rem 0;
}

.page-404 h1 {
    font-size: 4.5rem;
    font-weight: 800;
    color: var(--border);
    line-height: 1;
}

.page-404 p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin: 0.5rem 0 1.5rem;
}

.btn-back {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 0.45rem 1.25rem;
    border-radius: var(--radius);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s;
}

.btn-back:hover {
    background: var(--accent-hover);
    color: #fff;
}

/* ---- Crypto Address (payment) ---- */
.crypto-address {
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 0.8rem;
    word-break: break-all;
    background: #f3f4f6;
    padding: 0.55rem 0.75rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.payment-timer {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--accent);
}

/* ---- Container override ---- */
.container {
    max-width: 100%;
    padding-left: 0;
    padding-right: 0;
}

/* ---- Utility ---- */
.content {
    font-size: 0.88rem;
    line-height: 1.75;
    color: var(--text-secondary);
}

.content h2, .content h3 {
    color: var(--text-primary);
}

/* ---- Dropdown styling ---- */
.dropdown-menu {
    font-size: 0.8rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    border-radius: var(--radius);
}

.dropdown-item {
    font-size: 0.8rem;
    padding: 0.35rem 0.75rem;
}

.dropdown-item.active,
.dropdown-item:active {
    background: var(--accent);
}
