/* Smartphones Inventory Page Styles */

body.smartphones-page {
    background-image: url('../images/1st/walpaper.jpg');
    background-size: cover;
    background-attachment: fixed;
    background-position: center;
    margin: 0;
    padding: 0;
}

.page-main-wrapper {
    padding: 0 50px;
}

.dark-container {
    background: linear-gradient(135deg, #1a2332 0%, #243447 100%);
    padding: 0 0 40px 0;
    min-height: 100vh;
    max-width: 1200px !important;
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}

.smartphones-container {
    margin: 40px 15px;
    background: #F5F5F7;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    max-width: 100%;
    box-sizing: border-box;
}

.back-link-wrapper {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid rgba(0, 0, 0, 0.05);
}

.filter-and-content-wrapper {
    display: flex;
    gap: 30px;
    max-width: 100%;
    box-sizing: border-box;
}

.back-button {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    background: #007AFF !important;
    color: white !important;
    text-decoration: none !important;
    border-radius: 8px;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 122, 255, 0.3);
    width: 180px;
    white-space: nowrap;
}

.back-button:hover {
    background: #0051D5 !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.4);
}

.back-button svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Filter Sidebar */
.filter-sidebar {
    flex: 0 0 280px;
    background: linear-gradient(135deg, #1a2332 0%, #243447 100%);
    border-radius: 12px;
    padding: 25px;
    color: white;
    height: fit-content;
    position: sticky;
    top: 20px;
}

.filter-section {
    margin-bottom: 30px;
}

.filter-section:last-child {
    margin-bottom: 0;
}

.filter-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #ffffff;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 8px;
}

.filter-option {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

.filter-option input[type="checkbox"],
.filter-option input[type="radio"] {
    margin-right: 10px;
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #007AFF;
}

.filter-option label {
    cursor: pointer;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
}

.price-inputs {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.price-inputs input {
    flex: 1;
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 14px;
}

.price-inputs input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.filter-apply-btn {
    width: 100%;
    padding: 12px;
    background: #007AFF;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 20px;
    transition: background 0.3s ease;
}

.filter-apply-btn:hover {
    background: #0051D5;
}

.filter-reset-btn {
    width: 100%;
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    margin-top: 10px;
    transition: all 0.3s ease;
}

.filter-reset-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Content Area */
.content-area {
    flex: 1;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

.page-title {
    text-align: center;
    font-size: 32px;
    font-weight: 700;
    color: #1d1d1f;
    margin-bottom: 10px;
}

.device-count {
    text-align: center;
    color: #6e6e73;
    margin-bottom: 30px;
    font-size: 16px;
}

/* Device Grid */
.devices-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 25px;
    max-width: 100%;
}

@media (min-width: 769px) and (max-width: 1200px) {
    .devices-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1201px) {
    .devices-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.device-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
    position: relative;
}

.device-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.device-image-wrapper {
    position: relative;
    width: 100%;
    height: 240px;
    background: #f8f8f8;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
    box-sizing: border-box;
}

.device-image {
    max-width: 100%;
    max-height: 100%;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    display: block;
}

.badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    z-index: 1;
}

.hot-deal-badge {
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8e53 100%);
    color: white;
}

.discount-badge {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.device-info {
    padding: 20px;
}

.device-name {
    font-size: 18px;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 8px;
    line-height: 1.3;
}

.device-specs {
    font-size: 14px;
    color: #6e6e73;
    margin-bottom: 12px;
}

.device-price {
    font-size: 24px;
    font-weight: 700;
    color: #007AFF;
}

.price-with-discount {
    display: flex;
    align-items: center;
    gap: 10px;
}

.original-price {
    font-size: 18px;
    color: #86868b;
    text-decoration: line-through;
}

.discounted-price {
    font-size: 24px;
    font-weight: 700;
    color: #10b981;
}

.no-devices {
    text-align: center;
    padding: 60px 20px;
    color: #6e6e73;
}

.no-devices-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.3;
}

.no-devices h3 {
    font-size: 24px;
    color: #1d1d1f;
    margin-bottom: 10px;
}

.no-devices p {
    font-size: 16px;
}

/* Mobile Filter Button */
.mobile-filter-toggle {
    display: none;
}

/* Mobile Responsive */
@media (max-width: 1024px) {
    .filter-and-content-wrapper {
        flex-direction: column;
    }
    
    .filter-sidebar {
        position: static;
        flex: 1;
    }
    
    .devices-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }
}

@media (max-width: 768px) {
    /* Show mobile filter button */
    .mobile-filter-toggle {
        display: block;
        width: 100%;
        padding: 14px 20px;
        background: #007AFF;
        color: white;
        border: none;
        border-radius: 8px;
        font-weight: 600;
        font-size: 16px;
        cursor: pointer;
        margin-bottom: 20px;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        transition: background 0.3s ease;
    }
    
    .mobile-filter-toggle:hover {
        background: #0051D5;
    }
    
    .mobile-filter-toggle svg {
        width: 20px;
        height: 20px;
    }
    
    /* Hide desktop sidebar, show as slide-in on mobile */
    .filter-sidebar {
        position: fixed;
        top: 0;
        right: -100%;
        width: 85%;
        max-width: 350px;
        height: 100vh;
        z-index: 1000;
        transition: right 0.3s ease;
        overflow-y: auto;
        padding: 20px;
    }
    
    .filter-sidebar.active {
        right: 0;
    }
    
    /* Overlay */
    .filter-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        opacity: 0;
        transition: opacity 0.3s ease;
    }
    
    .filter-overlay.active {
        display: block;
        opacity: 1;
    }
    
    /* Close button in mobile sidebar */
    .mobile-filter-close {
        display: block;
        width: 100%;
        padding: 12px;
        background: rgba(255, 255, 255, 0.2);
        color: white;
        border: 1px solid rgba(255, 255, 255, 0.3);
        border-radius: 8px;
        font-weight: 600;
        cursor: pointer;
        margin-bottom: 20px;
        transition: background 0.3s ease;
        font-size: 15px;
    }
    
    .mobile-filter-close:hover {
        background: rgba(255, 255, 255, 0.3);
    }
    
    /* Hide close button on desktop */
}

@media (min-width: 769px) {
    .mobile-filter-close {
        display: none;
    }
    
    .page-main-wrapper {
        padding: 0;
    }
    
    .dark-container {
        max-width: 100%;
    }
    
    .smartphones-container {
        margin: 40px 10px;
        padding: 20px;
    }
    
    .page-title {
        font-size: 24px;
    }
    
    .devices-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 15px;
    }
    
    .device-image-wrapper {
        min-height: 200px;
        height: 200px;
        padding: 12px;
    }
}

@media (max-width: 768px) {
    .page-main-wrapper {
        padding: 0;
    }
    
    .dark-container {
        max-width: 100%;
    }
    
    .smartphones-container {
        margin: 40px 10px;
        padding: 20px;
    }
    
    .page-title {
        font-size: 24px;
    }
    
    .devices-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 15px;
    }
    
    .filter-sidebar {
        padding: 20px;
    }
    
    .device-image-wrapper {
        min-height: 200px;
        height: 200px;
        padding: 12px;
    }
}

@media (max-width: 480px) {
    .devices-grid {
        grid-template-columns: 1fr;
    }
    
    .filter-sidebar {
        width: 90%;
        max-width: 320px;
    }
}
