/* Amazon Category Page Styles */
/* Unique prefix: .amazon-category- to prevent conflicts */

/* Reset and Base Styles */
.amazon-category-container {
    font-family: 'Amazon Ember', Arial, sans-serif;
    line-height: 1.6;
    color: #0f1111;
    background-color: #ffffff;
}

.amazon-category-container * {
    box-sizing: border-box;
}

/* Breadcrumb Navigation */
.breadcrumb-nav {
    background-color: #f3f3f3;
    border-bottom: 1px solid #ddd;
    padding: 8px 0;
    font-size: 12px;
}

.breadcrumb-list {
    display: flex;
    align-items: center;
    margin: 0;
    padding: 0;
    list-style: none;
    flex-wrap: wrap;
}

.breadcrumb-list li {
    display: flex;
    align-items: center;
}

.breadcrumb-list li:not(:last-child)::after {
    content: '›';
    margin: 0 8px;
    color: #565959;
    font-weight: bold;
}

.breadcrumb-list a {
    color: #007185;
    text-decoration: none;
    transition: color 0.2s ease;
}

.breadcrumb-list a:hover {
    color: #c7511f;
    text-decoration: underline;
}

.breadcrumb-list .active {
    color: #565959;
    font-weight: 500;
}

/* Main Content Layout */
.main-content {
    min-height: calc(100vh - 200px);
    padding: 0;
}

.category-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 20px;
    max-width: 1500px;
    margin: 0 auto;
    padding: 16px;
}

/* Category Header */
.category-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e7e7e7;
}

.category-info h1.category-title {
    font-size: 28px;
    font-weight: 400;
    margin: 0 0 8px 0;
    color: #0f1111;
    line-height: 1.2;
}

.category-description {
    font-size: 14px;
    color: #565959;
    margin: 0;
    max-width: 600px;
    line-height: 1.4;
}

/* Mobile Filter Toggle */
.mobile-filter-toggle {
    display: none;
    align-items: center;
    gap: 8px;
    background: #fff;
    border: 1px solid #d5d9d9;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 14px;
    color: #0f1111;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mobile-filter-toggle:hover {
    background-color: #f7f8f8;
    border-color: #c7c7c7;
}

.mobile-filter-toggle .filter-icon {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* Results Toolbar */
.results-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding: 12px 0;
    border-bottom: 1px solid #e7e7e7;
    flex-wrap: wrap;
    gap: 12px;
}

.results-info {
    font-size: 14px;
    color: #565959;
}

.results-count strong {
    color: #0f1111;
    font-weight: 600;
}

/* Sort Controls */
.sort-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sort-label {
    font-size: 14px;
    color: #0f1111;
    font-weight: 500;
}

.sort-select {
    background: #fff;
    border: 1px solid #d5d9d9;
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 14px;
    color: #0f1111;
    cursor: pointer;
    min-width: 160px;
    transition: border-color 0.2s ease;
}

.sort-select:focus {
    outline: none;
    border-color: #007185;
    box-shadow: 0 0 0 2px rgba(0, 113, 133, 0.1);
}

.sort-select:hover {
    border-color: #c7c7c7;
}

/* Products Grid Container */
.products-grid-container {
    margin-bottom: 24px;
}

/* Ensure products-grid-container inherits grid layout */
.products-grid-container.amazon-products-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)) !important;
    gap: 20px !important;
    padding: 20px 0 !important;
}

/* Item wrapper styling */
.products-grid-container .item {
    width: 100%;
}

/* History item styling within products grid */
.products-grid-container .item .history-item {
    background: white;
    border: 1px solid #e7e7e7;
    border-radius: 8px;
    padding: 16px;
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    text-align: center;
}

.products-grid-container .item .history-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
    border-color: #ff9900;
}

/* Pagination Container */
.pagination-container {
    display: flex;
    justify-content: center;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid #e7e7e7;
}

/* Mobile Filter Overlay */
.mobile-filter-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-filter-overlay.active {
    opacity: 1;
}

/* Loading Spinner */
.loading-spinner {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.95);
    padding: 24px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    text-align: center;
    min-width: 200px;
}

.loading-spinner.show {
    display: block;
}

.spinner-circle {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #ff9900;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 12px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.loading-spinner span {
    font-size: 14px;
    color: #565959;
    display: block;
}

/* Toast Notifications */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1001;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    max-width: 400px;
    min-width: 300px;
}

.toast.show {
    transform: translateX(0);
}

.toast-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
}

.toast-message {
    font-size: 14px;
    color: #0f1111;
    flex: 1;
}

.toast-close {
    background: none;
    border: none;
    font-size: 18px;
    color: #565959;
    cursor: pointer;
    padding: 0;
    margin-left: 12px;
    line-height: 1;
}

.toast-close:hover {
    color: #0f1111;
}

/* Toast Types */
.toast-success {
    border-left: 4px solid #067d62;
}

.toast-error {
    border-left: 4px solid #d13212;
}

.toast-info {
    border-left: 4px solid #007185;
}

.toast-warning {
    border-left: 4px solid #f08804;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .category-layout {
        grid-template-columns: 200px 1fr;
        gap: 16px;
        padding: 12px;
    }

    .category-info h1.category-title {
        font-size: 24px;
    }
}

@media (max-width: 768px) {
    .category-layout {
        grid-template-columns: 1fr;
        gap: 0;
        padding: 8px;
    }

    .filter-sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 280px;
        height: 100vh;
        background: #fff;
        z-index: 999;
        transition: left 0.3s ease;
        overflow-y: auto;
        border-right: 1px solid #e7e7e7;
    }

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

    .mobile-filter-toggle {
        display: flex;
    }

    .mobile-filter-overlay {
        display: block;
    }

    .category-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .results-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .sort-controls {
        justify-content: space-between;
    }

    .sort-select {
        flex: 1;
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .category-layout {
        padding: 4px;
    }

    .filter-sidebar {
        width: 100%;
        left: -100%;
    }

    .category-info h1.category-title {
        font-size: 20px;
    }

    .breadcrumb-nav {
        padding: 6px 0;
    }

    .breadcrumb-list {
        font-size: 11px;
    }

    .toast {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
        min-width: auto;
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2),
(min-resolution: 192dpi) {
    .spinner-circle {
        border-width: 2px;
    }
}

/* Dark Mode Support (if needed) */
@media (prefers-color-scheme: dark) {
    .amazon-category-container {
        color: #ffffff;
        /* background-color: #0f1419; */
    }

    .breadcrumb-nav {
        /* background-color: #1a1a1a; */
        border-bottom-color: #333;
    }

    .category-header {
        border-bottom-color: #333;
    }

    .results-toolbar {
        border-bottom-color: #333;
    }

    .sort-select {
        /* background: #1a1a1a; */
        border-color: #333;
        color: #030000;
    }

    .mobile-filter-toggle {
        background: #1a1a1a;
        border-color: #333;
        color: #ffffff;
    }

    .toast {
        background: #1a1a1a;
        color: #ffffff;
    }
}

/* Print Styles */
@media print {

    .mobile-filter-toggle,
    .mobile-filter-overlay,
    .loading-spinner,
    .toast {
        display: none !important;
    }

    .category-layout {
        grid-template-columns: 1fr;
    }

    .filter-sidebar {
        display: none;
    }
}




.category-header {
    display: flex;
    border: 0;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
}