/* Mobile Styles (< 768px) */

/* Layout & Containers */
.admin-layout {
    flex-direction: column;
}

html, body {
    overflow-x: hidden;
    width: 100%;
    position: relative;
}

.container {
    padding-left: 16px !important;
    padding-right: 16px !important;
    margin: 0 auto !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.page-wrap {
    padding-top: 24px !important;
    padding-bottom: 60px !important;
}


/* Sidebar Off-canvas */
.sidebar {
    position: fixed;
    left: -100%;
    top: 0;
    bottom: 0;
    z-index: 5000;
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 20px 0 50px rgba(0,0,0,0.1);
}

.sidebar.mobile-active {
    left: 0;
}

.sidebar.collapsed {
    width: 260px;
    padding: var(--spacing-lg);
}

.sidebar.collapsed .nav-label,
.sidebar.collapsed .sidebar-brand-text {
    display: block;
}

/* Main Content */
.admin-content {
    padding: 20px 16px !important;
}

/* Product Grid (2 Columns) */
.product-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
}

.product-image {
    aspect-ratio: 1 / 1.1;
}

.product-info {
    padding: 10px !important;
}

.product-title {
    font-size: 13px !important;
    line-height: 1.2;
}

.product-price {
    font-size: 12px !important;
}


/* Generic Grid */
.grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
}

/* Table Controls Stacking */
.table-header {
    flex-direction: column-reverse; /* Actions on top, search below */
    align-items: stretch !important;
    gap: 16px !important;
}

.table-actions {
    justify-content: stretch;
    gap: 8px !important;
}

.table-actions .btn {
    flex: 1;
    justify-content: center;
}

.search-container {
    max-width: 100% !important;
    width: 100%;
}

/* Storefront Layouts */
.module-two-col {
    flex-direction: column !important;
    gap: 32px !important;
}

.module-main, .module-side {
    width: 100% !important;
}

/* Cart Specifics */
.cart-table thead {
    display: none; /* Hide headers on mobile */
}

.cart-table tr {
    display: block;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-color);
}

.cart-table td {
    display: block;
    padding: 4px 0 !important;
    text-align: right;
    position: relative;
}

.cart-table td:first-child {
    display: flex;
    text-align: left;
    gap: 16px;
    margin-bottom: 12px;
}

.cart-table td::before {
    content: attr(data-label);
    float: left;
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.cart-table td:first-child::before {
    display: none;
}

/* Profile Specifics */
.profile-header {
    flex-direction: column;
    align-items: center !important;
    text-align: center;
    gap: 20px;
}

.metric-card {
    margin-bottom: 8px;
}

/* Form Grid */
.input-grid {
    grid-template-columns: 1fr !important;
}

/* Modals */
.modal-card {
    width: 90% !important;
    max-width: 380px !important;
    margin: 0 !important; /* Centered by flex parent */
    border-radius: var(--radius-lg);
    background: #fff;
    overflow: hidden;
    position: relative;
    padding: 0 !important;
}

.modal-header {
    padding: 12px 16px !important;
}

.modal-header h3 {
    font-size: 14px !important;
}

.modal-body {
    padding: 16px !important;
}

.modal-footer {
    padding: 12px 16px !important;
}

.quick-attr-group {
    margin-bottom: 12px !important;
}

.quick-attr-group label {
    margin-bottom: 6px !important;
}

.attr-opt-btn {
    padding: 6px 12px !important;
    font-size: 12px !important;
}

/* Storefront Grid */
.store-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 16px !important;
}

/* Product Cards */
.product-card {
    border-radius: var(--radius-lg);
    background: #fff;
    border: 1px solid var(--border-color);
    overflow: hidden;
    position: relative;
    transition: var(--transition);
    padding: 0 !important;
}

.product-image {
    aspect-ratio: 1;
    position: relative;
    background: #f8f8f8;
    overflow: hidden;
}

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

.product-info {
    padding: 12px !important;
}

.product-title {
    font-size: 14px !important;
    line-height: 1.3;
}

.product-price {
    font-size: 13px !important;
}

.product-card .add-to-cart {
    width: 100% !important;
    margin: 0 !important;
    padding: 14px !important;
    font-size: 11px !important;
    border-radius: 0 !important;
    border: none !important;
    border-top: 1px solid var(--border-color) !important;
}

/* Page Headers */
.section-header, .collection-header {
    padding: 40px 0 !important;
    text-align: center;
}

.collection-header h1 {
    font-size: 28px !important;
}

/* Filter Bar */
.filter-bar {
    flex-direction: column;
    align-items: stretch !important;
}

.filter-group {
    width: 100%;
    justify-content: space-between;
}

.filter-select {
    flex: 1;
}

/* Login/Signup Containers */
.auth-container {
    padding: 24px !important;
    box-shadow: none !important;
    border: none !important;
}

/* Tables */
.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    min-width: 600px;
}

/* Cart page: override table min-width so it doesn't scroll horizontally */
.cart-table {
    min-width: 0 !important;
    width: 100% !important;
    table-layout: fixed;
}
.cart-page-wrap .table-container {
    overflow-x: hidden !important;
}

/* Two-Column Module Layout Fix */
.module-two-col {
    flex-direction: column !important;
    gap: 20px !important;
    width: 100%;
}

.module-main, .module-side {
    width: 100% !important;
    flex: none !important;
}

.module-side {
    position: static !important;
}

/* UI Cleanup */
h1 { font-size: 24px; }
h2 { font-size: 20px; }
h3 { font-size: 18px; }

.card {
    width: 100%; /* Ensure cards fill the width */
}
