/* Shop Layout - Mobile First */

:root {
    --shop-primary: #526C2B;
    --shop-secondary: #F0800F;
    --shop-tertiary: #EB9725;
    --shop-bg: #FFFFFF;
    --shop-surface: #FFFFFF;
    --shop-surface-variant: #f4f7f0;
    --shop-text: #2d3a1f;
    --shop-text-secondary: #5a6b4a;
    --shop-line: rgba(0, 0, 0, 0.07);
    --shop-line-strong: rgba(0, 0, 0, 0.45);
    --shop-header-height: 60px;
    --shop-bottom-nav-height: 72px;
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
}

[data-theme="dark"] {
    --shop-primary: #8ab64d;
    --shop-secondary: #F0800F;
    --shop-tertiary: #EB9725;
    --shop-bg: #12140e;
    --shop-surface: #24281c;
    --shop-surface-variant: #1e2416;
    --shop-text: #f0f4eb;
    --shop-text-secondary: #b0c0a0;
    --shop-line: rgba(255, 255, 255, 0.08);
    --shop-line-strong: rgba(255, 255, 255, 0.5);
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    background-color: var(--shop-bg);
}

/* Skip Link (Accessibility) */
.skip-link {
    position: absolute;
    top: -100%;
    left: 1rem;
    z-index: 9999;
    padding: 0.75rem 1.25rem;
    background: var(--shop-primary);
    color: white;
    border-radius: 0 0 8px 8px;
    text-decoration: none;
    font-weight: 600;
    transition: top 0.2s;
}

.skip-link:focus {
    top: 0;
}

/* Shop Layout Container */
.shop-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
}

/* Header */
.shop-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--shop-header-height);
    background-color: var(--shop-surface);
    border-bottom: 1px solid rgba(82, 108, 43, 0.1);
    z-index: 1000;
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 12px;
    transition: background-color 0.3s, border-color 0.3s;
}

[data-theme="dark"] .shop-header {
    border-bottom-color: rgba(138, 182, 77, 0.15);
}

.shop-header-logo {
    height: 40px;
    width: auto;
    object-fit: contain;
}

.shop-header-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--shop-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

/* Main Content */
.shop-content {
    flex: 1;
    padding-top: var(--shop-header-height);
    padding-bottom: calc(var(--shop-bottom-nav-height) + var(--safe-area-bottom));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.shop-content-inner {
    padding: 16px;
    max-width: 100%;
    margin: 0 auto;
}

.shop-back-btn {
    background-color: var(--mud-palette-action-default-hover) !important;
    min-height: 56px;
}


/* Powered by (header) */
.shop-header-powered-by {
    font-size: 0.625rem;
    color: var(--shop-text-secondary);
    text-decoration: none;
    white-space: nowrap;
}

/* Theme toggle in shop header - keep in flex flow, override landing.css absolute positioning */
.shop-header .theme-toggle {
    position: relative;
    top: auto;
    right: auto;
    flex-shrink: 0;
}

.shop-header-powered-by:hover {
    text-decoration: underline;
}

/* Bottom Navigation */
.shop-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(var(--shop-bottom-nav-height) + var(--safe-area-bottom));
    padding-bottom: var(--safe-area-bottom);
    background-color: var(--shop-surface);
    border-top: 1px solid rgba(82, 108, 43, 0.1);
    z-index: 1000;
    display: flex;
    justify-content: space-around;
    align-items: center;
    transition: background-color 0.3s, border-color 0.3s;
}

[data-theme="dark"] .shop-bottom-nav {
    border-top-color: rgba(138, 182, 77, 0.15);
}

.shop-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    color: var(--shop-text-secondary);
    text-decoration: none;
    transition: color 0.2s, background-color 0.2s;
    min-width: 48px;
    min-height: 48px;
    border-radius: 12px;
    margin: 10px 2px;
    -webkit-tap-highlight-color: transparent;
}

.shop-nav-item:hover,
.shop-nav-item:focus {
    color: var(--shop-primary);
}

.shop-nav-item.active {
    color: var(--shop-primary);
    background-color: rgba(82, 108, 43, 0.1);
}

[data-theme="dark"] .shop-nav-item.active {
    background-color: rgba(138, 182, 77, 0.15);
}

.shop-nav-item .nav-icon {
    font-size: 24px;
    margin-bottom: 2px;
}

.shop-nav-item .nav-label {
    font-size: 0.75rem;
    font-weight: 500;
}

/* Cart Badge */
.shop-nav-item .nav-badge {
    position: absolute;
    top: -6px;
    right: -10px;
    background-color: var(--shop-secondary);
    color: white;
    font-size: 0.625rem;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.nav-icon-wrapper {
    position: relative;
    display: inline-flex;
}

/* Loading State */
.shop-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    color: var(--shop-text-secondary);
}

/* Error State */
.shop-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    padding: 24px;
    text-align: center;
}

.shop-error-icon {
    font-size: 48px;
    color: var(--shop-secondary);
    margin-bottom: 16px;
}

.shop-error-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--shop-text);
    margin-bottom: 8px;
}

.shop-error-message {
    color: var(--shop-text-secondary);
}

/* Utility Classes */
.shop-card {
    background: var(--shop-surface);
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.3s;
}

.shop-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.shop-card:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

/* Interactive card (clickable) */
.shop-card-interactive {
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.shop-card-interactive:active {
    transform: scale(0.98);
}

/* Buttons */
.shop-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.shop-btn:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.shop-btn:active {
    transform: scale(0.96);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.shop-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

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

.shop-btn-primary:hover {
    background-color: #455a24;
}

.shop-btn-secondary {
    background-color: var(--shop-secondary);
    color: white;
}

.shop-btn-secondary:hover {
    background-color: #d97008;
}

/* Loading containers */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    gap: 16px;
}

.loading-container-fullpage {
    min-height: calc(100vh - var(--shop-header-height) - var(--shop-bottom-nav-height));
}

.loading-text {
    color: var(--shop-text-secondary);
    font-size: 0.875rem;
}

/* Error container fullpage */
.error-container-fullpage {
    min-height: calc(100vh - var(--shop-header-height) - var(--shop-bottom-nav-height));
}

/* Toast/Snackbar animation */
.toast-enter {
    animation: slideInFromBottom 0.3s ease-out;
}

/* Badge bounce animation */
.badge-bounce {
    animation: bounce 0.3s ease;
}

/* Loading spinner animation */
.loading-spinner {
    animation: spin 1s linear infinite;
}

/* Pulse animation for loading states */
.loading-pulse {
    animation: pulse 1.5s ease-in-out infinite;
}

/* Focus states for accessibility */
.shop-btn:focus-visible,
.shop-card-interactive:focus-visible,
.shop-nav-item:focus-visible {
    outline: 2px solid var(--shop-primary);
    outline-offset: 2px;
}

/* Responsive adjustments for larger screens */
@media (min-width: 768px) {
    .shop-content-inner {
        padding: 24px 48px;
    }

    .shop-header {
        padding: 0 24px;
    }
}

@media (min-width: 1200px) {
    .shop-content-inner {
        padding: 32px 64px;
    }
}

/* Hide labels on very small screens instead of hiding whole tabs */
@media (max-width: 360px) {
    .shop-nav-item .nav-label {
        display: none;
    }
}

/* Offline Indicator */
.offline-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--shop-tertiary);
    color: #fff;
    cursor: pointer;
    animation: offline-pulse 2s ease-in-out infinite;
}

@keyframes offline-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.offline-info-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1100;
}

.offline-info-popup {
    position: fixed;
    top: calc(var(--shop-header-height) + 4px);
    right: 16px;
    z-index: 1101;
    max-width: 260px;
    padding: 10px 14px;
    border-radius: 8px;
    background-color: var(--shop-surface);
    color: var(--shop-text);
    font-size: 0.8125rem;
    line-height: 1.4;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
    border: 1px solid rgba(82, 108, 43, 0.12);
}

[data-theme="dark"] .offline-info-popup {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    border-color: rgba(138, 182, 77, 0.15);
}
