/* Base Resets and Variables */
:root {
    --primary-color: #1a1a1a;
    --accent-color: #d4af37; /* Gold accent for luxury feel */
    --accent-hover: #b5952f;
    --bg-color: #fcfcfc;
    --card-bg: #ffffff;
    --text-primary: #2c2c2c;
    --text-secondary: #666666;
    --border-color: #eaeaea;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 40px;
    --border-radius-sm: 4px;
    --border-radius-md: 12px;
    --border-radius-lg: 20px;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.04);
    --shadow-md: 0 8px 24px rgba(0,0,0,0.08);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    width: 100%;
    max-width: 600px; /* Mobile-first, narrow content width for readability */
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

/* Header & Footer */
.site-header {
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    padding: var(--spacing-md) 0;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.site-header h1 {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--primary-color);
    text-transform: uppercase;
}

.site-footer {
    text-align: center;
    padding: var(--spacing-xl) var(--spacing-md);
    font-size: 0.85rem;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-color);
    margin-top: var(--spacing-xl);
}

/* Product Page Layout */
.product-page {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    min-height: calc(100vh - 200px);
}

.product-card {
    background: var(--card-bg);
    display: flex;
    flex-direction: column;
}

/* Product Image */
.product-image-container {
    width: 100%;
    aspect-ratio: 4 / 3;
    background-color: #f5f2ee;
    position: relative;
    overflow: hidden;
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.product-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #a0a0a0;
    gap: var(--spacing-sm);
}

/* Product Details */
.product-details {
    padding: var(--spacing-lg) var(--spacing-md);
}

.product-title {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--spacing-sm);
    color: var(--primary-color);
}

.product-price-wrapper {
    display: flex;
    align-items: baseline;
    margin-bottom: var(--spacing-lg);
}

.product-price-wrapper .currency {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-right: var(--spacing-xs);
}

.product-price-wrapper .price {
    font-size: 2rem;
    font-weight: 600;
    color: var(--primary-color);
}

.product-description-section {
    margin-bottom: var(--spacing-xl);
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--border-color);
}

.product-description-section h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
    color: var(--primary-color);
}

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

/* Actions */
.product-actions {
    position: sticky;
    bottom: var(--spacing-md);
    padding-top: var(--spacing-sm);
    z-index: 10;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 24px;
    border: none;
    border-radius: var(--border-radius-md);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-block {
    width: 100%;
}

.btn-primary {
    background-color: var(--primary-color);
    color: #fff;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    background-color: #000;
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(0,0,0,0.12);
}

/* Error Pages */
.product-error-container {
    padding: var(--spacing-xl) var(--spacing-md);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
}

.error-icon {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-lg);
    opacity: 0.5;
}

.product-error-container h1 {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: var(--spacing-md);
}

.product-error-container p {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xl);
    max-width: 400px;
}

/* Desktop Enhancements */
@media (min-width: 768px) {
    .product-page {
        margin-top: var(--spacing-xl);
        margin-bottom: var(--spacing-xl);
        border-radius: var(--border-radius-lg);
        overflow: hidden;
        box-shadow: var(--shadow-md);
    }
    
    .product-actions {
        position: static;
        padding-top: var(--spacing-lg);
    }
}

/* ==========================================================================
   ADMIN DASHBOARD STYLES (Task 009)
   ========================================================================== */

.admin-body {
    background-color: #f4f6f8;
    margin: 0;
}

.admin-header {
    background-color: var(--primary-color);
    color: white;
    padding: 15px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.admin-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
}

.branding h1 {
    color: white;
    font-size: 1.5rem;
    margin-bottom: 2px;
}

.admin-subtitle {
    font-size: 0.85rem;
    color: var(--accent-color);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.admin-actions-nav a {
    color: white;
    text-decoration: none;
    margin-left: 15px;
    font-size: 0.95rem;
}

.btn-outline {
    border: 1px solid white;
    padding: 6px 12px;
    border-radius: 4px;
    background: transparent;
    transition: all 0.2s;
}

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

.admin-main {
    max-width: 100%;
    margin: 30px auto;
    padding: 0 20px;
    min-height: 70vh;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.dashboard-header h2 {
    font-size: 1.75rem;
    color: var(--text-primary);
}

.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: var(--border-radius-md);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    text-align: center;
    border: 1px solid var(--border-color);
}

.stat-card h3 {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
    font-weight: 500;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-number.success { color: #2e7d32; }
.stat-number.danger { color: #c62828; }

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 20px;
}

.product-card.inactive-card {
    opacity: 0.7;
    filter: grayscale(0.4);
}

.product-image-wrapper {
    position: relative;
    aspect-ratio: 1/1;
    background: #f5f2ee;
    border-top-left-radius: var(--border-radius-md);
    border-top-right-radius: var(--border-radius-md);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.status-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    padding: 2px 5px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
    color: white;
}

.status-badge.active { background-color: #2e7d32; }
.status-badge.inactive { background-color: #c62828; }

.qr-badge {
    display: inline-block;
    padding: 2px 6px;
    background-color: var(--accent-color);
    color: white;
    border-radius: 3px;
    font-size: 0.7rem;
    font-weight: bold;
    margin-left: 10px;
}

.product-details {
    padding: 6px 8px;
    border-left: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    background: white;
}

.product-details h4 {
    margin-bottom: 5px;
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-actions {
    display: flex;
    justify-content: space-between;
    padding: 6px 8px;
    background: #fafafa;
    border: 1px solid var(--border-color);
    border-top: none;
    border-bottom-left-radius: var(--border-radius-md);
    border-bottom-right-radius: var(--border-radius-md);
}

.btn-sm {
    padding: 3px 6px;
    font-size: 0.7rem;
}

.btn-text {
    color: var(--text-secondary);
    background: transparent;
    border: none;
    text-decoration: underline;
}

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

/* Admin Form Styles */
.admin-form-container {
    background: white;
    padding: 30px;
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary);
}

.form-group .required {
    color: #c62828;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: inherit;
    font-size: 1rem;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: normal !important;
}

.checkbox-label input {
    margin-right: 10px;
    width: 18px;
    height: 18px;
}

.form-hint {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: 4px;
    display: block;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.admin-footer {
    text-align: center;
    padding: 20px;
    margin-top: 40px;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* ==========================================================================
   COMPACT ADMIN GRID (Task 015)
   ========================================================================== */

/* Widen admin header to match */
.admin-header-content {
    max-width: 100%;
}

/* Reduce admin gap and grid */
.product-grid {
    gap: 8px;
}

/* Compact product price */
.admin-body .product-price {
    font-size: 0.75rem;
    margin: 0;
}

/* Compact product meta */
.admin-body .product-meta {
    font-size: 0.65rem;
    margin-top: 2px;
}

.admin-body .product-meta small {
    font-size: 0.6rem;
}

.admin-body .product-meta code {
    font-size: 0.55rem;
}

/* Compact product name spacing */
.admin-body .product-details h4 {
    margin-bottom: 2px;
    line-height: 1.2;
}

/* Compact QR badge */
.admin-body .qr-badge {
    font-size: 0.55rem;
    padding: 1px 4px;
    margin-left: 4px;
}

/* Compact status badge */
.admin-body .status-badge {
    font-size: 0.55rem;
    padding: 1px 4px;
}

/* Compact print checkbox overlay */
.admin-body .product-card label[style*="position: absolute"] {
    padding: 2px 4px !important;
    font-size: 10px !important;
}

.admin-body .product-card label span {
    font-size: 9px !important;
}

/* Compact stats */
.admin-body .stats-container {
    gap: 10px;
    margin-bottom: 15px;
}

.admin-body .stat-card {
    padding: 10px;
}

.admin-body .stat-number {
    font-size: 1.5rem;
}

.admin-body .stat-card h3 {
    font-size: 0.8rem;
    margin-bottom: 4px;
}

/* Compact dashboard header */
.admin-body .dashboard-header {
    margin-bottom: 12px;
}

.admin-body .dashboard-header h2 {
    font-size: 1.25rem;
}

/* Responsive Grid Breakpoints */
@media (min-width: 1600px) {
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    }
}

@media (min-width: 1200px) and (max-width: 1599px) {
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
}

@media (min-width: 900px) and (max-width: 1199px) {
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}

@media (min-width: 600px) and (max-width: 899px) {
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
}

@media (max-width: 599px) {
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
    
    .admin-body .product-details h4 {
        font-size: 0.65rem;
    }
    
    .admin-body .product-price {
        font-size: 0.65rem;
    }
    
    .btn-sm {
        padding: 2px 4px;
        font-size: 0.6rem;
    }
}

/* Compact product actions layout */
.admin-body .product-actions {
    flex-wrap: wrap;
    gap: 3px;
    justify-content: flex-start;
}

.admin-body .product-actions .btn-text {
    font-size: 0.65rem;
    padding: 2px 4px;
}

.admin-body .product-actions .delete-form button {
    font-size: 0.65rem;
    padding: 2px 4px;
}