/**
 * Steam XMR Store - Product Grid
 * Version: 2.0.0 (July 26, 2025)
 */

/* ===== PRODUCT GRID LAYOUT ===== */

/* Primary grid layout for headers and rows */
.products_list_header,
.product_item_list {
    display: grid;
    grid-template-columns: 60px 90px 1fr 90px 90px;
    align-items: center;
    width: 100%;
    margin: 0;
    padding: 10px;
    position: relative;
    text-align: center;
}

/* Container for the list should be full width */
.products_list {
    width: 100%;
    max-width: 100%;
}

/* Make sure products container is full width */
.products_container {
    width: 100%;
    max-width: 100%;
}

/* Product grid header */
.products_list_header {
    font-weight: 600;
    font-size: 13px;
    color: var(--steam-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, var(--steam-bg-accent) 0%, var(--steam-bg-secondary) 100%);
    border-bottom: 2px solid var(--steam-border);
    text-align: center;
}

.products_list_header span {
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
}

/* Ensure row has proper spacing */
.product_item_list {
    min-height: 50px;
    border-bottom: 1px solid rgba(42, 71, 94, 0.5);
    transition: background-color 0.2s ease;
    position: relative;
}

/* Hover effect */
.product_item_list:hover {
    background-color: rgba(0, 0, 0, 0.2);
}

/* ===== COLUMN LAYOUT & FORMATTING ===== */

/* Flag column - leftmost product indicator */
.product_flag {
    text-align: center;
    padding: 5px;
    font-size: 18px;
}

/* BIN column */
.product_number {
    text-align: center;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    color: #acdbf5;
}

/* Name column */
.product_name {
    padding: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    z-index: 2;
}

/* Product title */
.product_title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Price column */
.product_price {
    text-align: center;
    font-weight: bold;
    color: #c7d5e0;
}

/* Actions column */
.product_actions {
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2;
    position: relative;
}

/* ===== DETAILS BUTTON AND EXPANDABLE CONTENT ===== */

/* Hidden checkbox for expandable content */
.expand_trigger {
    display: none;
}

/* Full row clickable */
.row_click_overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    z-index: 1;
}

/* Make product row feel clickable */
.product_item_list {
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

.product_item_list:hover {
    background-color: rgba(42, 71, 94, 0.3);
}

/* Expandable details section */
.expandable_details {
    display: none;
    padding: 15px 20px;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(42, 71, 94, 0.5);
}

.expand_trigger:checked + .product_item_list + .expandable_details {
    display: block;
    animation: fadeIn 0.3s ease-in-out;
}

/* Detail row styling */
.detail_row {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.detail_row:last-child {
    border-bottom: none;
}

.detail_label {
    font-weight: bold;
    color: var(--steam-text-secondary);
}

.detail_content {
    color: var(--steam-text-primary);
}

/* Details button styling */
.view_button {
    /* Siempre oculto en escritorio */
    display: none !important; 
    background: linear-gradient(to bottom, #4b6b8d 5%, #2a4763 95%);
    border-radius: 2px;
    color: #c7d5e0;
    padding: 4px 8px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-right: 10px;
    white-space: nowrap;
    font-weight: 500;

/* Product title in expanded state */
.expand_trigger:checked ~ .product_item_list .view_button {
    background: linear-gradient(to bottom, #5b7a9c 5%, #3a5773 95%);
    color: #fff;
}

/* Animation for details */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ===== MOBILE POPUPS ===== */

/* Info button */
.info-button {
    display: none; /* Hidden by default, shown on mobile */
    width: 18px;
    height: 18px;
    background: linear-gradient(to bottom, #4b6b8d 5%, #2a4763 95%);
    border-radius: 50%;
    color: #c7d5e0;
    text-align: center;
    line-height: 18px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    margin-left: 10px;
    z-index: 10;
    font-style: italic;
}

/* Hide popup by default */
.popup-trigger {
    display: none;
}

.product-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 100;
    justify-content: center;
    align-items: center;
}

.popup-content {
    background: linear-gradient(135deg, var(--steam-bg-secondary) 0%, var(--steam-bg-primary) 100%);
    border: 1px solid var(--steam-border);
    border-radius: 8px;
    width: 90%;
    max-width: 340px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid var(--steam-border);
}

.popup-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--steam-text-primary);
    margin: 0;
}

.close-button {
    font-size: 24px;
    color: var(--steam-text-secondary);
    cursor: pointer;
    line-height: 1;
}

.popup-body {
    padding: 15px;
}

.product-detail-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 13px;
}

.detail-label {
    font-weight: 600;
    color: var(--steam-text-secondary);
}

.popup-footer {
    padding: 15px;
    border-top: 1px solid var(--steam-border);
    text-align: center;
}

.popup-buy-button {
    display: inline-block;
    background: linear-gradient(to bottom, #75b022 5%, #588a1b 95%);
    border: none;
    border-radius: 2px;
    color: white;
    padding: 10px 15px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
}

/* Show popup when trigger is checked */
.popup-trigger:checked + .info-button + .product-popup {
    display: flex;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    /* Mobile grid layout */
    .products_list_header {
        grid-template-columns: 40px 65px 1fr 60px 50px;
        padding: 8px 5px;
        gap: 4px;
        font-size: 11px;
    }
    
    .product_item_list {
        grid-template-columns: 40px 65px 1fr 60px 65px;
        padding: 10px 5px;
        min-height: 50px;
    }
    
    /* Mobile name column */
    .product_name {
        display: flex;
        align-items: center;
    }
    
    /* Only show the view button on mobile */
    .view_button {
        display: inline-block !important; /* Force display on mobile */
    }
    
    /* Show info button in mobile */
    .info-button {
        display: inline-block;
    }
    
    /* Mobile flag */
    .product_flag {
        font-size: 16px;
        padding: 2px;
    }
    
    /* Mobile BIN */
    .product_number {
        font-size: 9px;
    }
    
    /* Mobile price */
    .product_price {
        font-size: 12px;
    }
    
    /* Mobile buy button */
    .btn_buy {
        padding: 6px 8px;
        font-size: 11px;
        min-width: 40px;
    }
}

@media (max-width: 480px) {
    .products_list_header {
        grid-template-columns: 30px 55px 1fr 50px 55px;
        padding: 6px 3px;
        gap: 3px;
        font-size: 9px;
    }
    
    .product_item_list {
        grid-template-columns: 30px 55px 1fr 50px 55px;
        padding: 8px 3px;
        gap: 3px;
    }
    
    .product_flag {
        font-size: 14px;
    }
    
    .product_number {
        font-size: 8px;
    }
    
    .view_button {
        font-size: 9px;
        padding: 3px 6px;
    }
    
    .btn_buy {
        padding: 4px 6px;
        font-size: 10px;
        min-width: 35px;
    }
}
/**
 * Product Name Alignment Fix
 * Ensures product names are properly left-aligned
 * Version: 1.0.0 (2025-07-26)
 */

/* Fix for product name alignment */
.product_name {
    text-align: left !important;
    justify-content: flex-start !important;
    padding-left: 10px !important;
}

.product_title {
    text-align: left !important;
    width: 100% !important;
}

/* Fix for table headers alignment */
.products_list_header span {
    justify-content: center !important;
}

.products_list_header span:nth-child(3) {
    justify-content: flex-start !important;
    padding-left: 10px !important;
}

/* Fix for expandable products */
.expandable_product_name {
    text-align: left !important;
    justify-content: flex-start !important;
}

/* Ensure proper alignment of all rows */
.product_item_list {
    text-align: left !important;
}
