/* ============================================
   Inventory View Page - Responsive Design
   ============================================ */

/* Container Styling */
.inventory-view-container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
}

.inventory-view-container .container-content {
    padding: 20px;
    background: #F5F5F7;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Back Button */
.back-link {
    margin-bottom: 25px;
    overflow: visible;
}

.back-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white !important;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
    border: none;
    white-space: nowrap;
    min-width: fit-content;
}

.back-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.5);
    background: linear-gradient(135deg, #0056b3 0%, #004085 100%);
    color: white !important;
}

.back-button svg {
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.back-button:hover svg {
    transform: translateX(-3px);
}

/* Category Path Wrapper - Hidden on desktop, shown on mobile above images */
.category-path-wrapper {
    display: none;
}

.category-path-wrapper .category-path {
    font-size: 14px;
    color: #6c757d;
    font-weight: 500;
    margin-bottom: 20px;
}

.category-path-wrapper .category-path .separator {
    margin: 0 5px;
}

.category-path-wrapper .category-path .brand {
    color: #667eea;
    font-weight: 600;
}

/* Device Detail Grid */
.device-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-top: 30px;
}

/* Image Section */
.device-image-section {
    position: relative;
}

.device-image-section .image-container {
    position: relative;
    background: #f8f9fa;
    border-radius: 16px;
    overflow: hidden;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
}

.device-image-section img {
    width: 100%;
    height: auto;
    max-height: 600px;
    object-fit: contain;
    border-radius: 12px;
    display: block;
    margin: 0 auto;
}

/* Remove hover effect to maintain consistent size */
.device-image-section img:hover {
    transform: none;
}

/* Image Thumbnails Gallery */
.image-thumbnails {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.thumbnail {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.3s ease;
    background: #f8f9fa;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.thumbnail:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.thumbnail.active {
    border-color: #764ba2;
    box-shadow: 0 4px 15px rgba(118, 75, 162, 0.4);
}

.thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: none;
    border-radius: 0;
}

.thumbnail img:hover {
    transform: none;
}

.sold-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(220, 53, 69, 0.95);
    color: white;
    padding: 20px 40px;
    border-radius: 12px;
    font-size: 32px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 3px;
    box-shadow: 0 8px 20px rgba(220, 53, 69, 0.4);
    z-index: 10;
}

/* Device Info Section */
.device-info-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Original Category Path - Shown on desktop only, hidden on mobile */
.device-info-section .category-path {
    font-size: 14px;
    color: #6c757d;
    font-weight: 500;
    display: block;
}

.device-info-section .category-path .separator {
    margin: 0 5px;
}

.device-info-section .category-path .brand {
    color: #667eea;
    font-weight: 600;
}

.device-title {
    font-size: 32px;
    font-weight: 700;
    color: #000000;
    margin: 0;
    line-height: 1.2;
}

.device-storage,
.device-carrier {
    font-size: 32px;
    font-weight: 700;
    color: #000000;
    margin-left: 10px;
}

.device-storage::before {
    content: "- ";
}

/* Deal Banners */
.deal-banner {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: pulse 2s ease-in-out infinite;
}

.hot-deal-banner {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    color: white;
    border: 2px solid #ff8787;
}

.discount-banner {
    background: linear-gradient(135deg, #51cf66 0%, #37b24d 100%);
    color: white;
    border: 2px solid #69db7c;
}

.deal-banner svg {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
}

/* Price Box */
.device-price-box {
    background: #ffffff;
    padding: 20px;
    border-radius: 12px;
    border: 2px solid #2d3748;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.device-price-box .price-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.price-with-discount {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    width: 100%;
}

.original-price-strike {
    color: #6c757d;
    font-size: 20px;
    font-weight: 500;
    text-decoration: line-through;
}

.price-label {
    color: #2d3748;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 5px;
}

.price-value {
    color: #007bff;
    font-size: 48px;
    font-weight: 700;
    line-height: 1;
}

.price-value.discounted {
    color: #007bff;
}

/* Availability Badge */
.availability-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    width: fit-content;
}

.availability-badge.available {
    background: #d4edda;
    color: #155724;
    border: 2px solid #c3e6cb;
}

.availability-badge.sold {
    background: #f8d7da;
    color: #721c24;
    border: 2px solid #f5c6cb;
}

/* Product Description Box */
.device-description-box {
    background: #ffffff;
    padding: 25px;
    border-radius: 12px;
    border: 2px solid #2d3748;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.device-description-box h3 {
    margin: 0 0 15px 0;
    font-size: 20px;
    font-weight: 700;
    color: #2d3748;
    display: flex;
    align-items: center;
    padding-bottom: 10px;
    border-bottom: 2px solid #2d3748;
}

.device-description-box h3 svg {
    color: #2d3748;
}

.description-content {
    background: transparent;
    padding: 15px 0 0 0;
    border-radius: 0;
    box-shadow: none;
}

.description-content p {
    color: #2d3748;
    line-height: 1.7;
    margin: 0;
    font-size: 15px;
}

/* Specifications */
.device-specifications {
    background: #ffffff;
    padding: 25px;
    border-radius: 12px;
    border: 2px solid #2d3748;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.device-specifications h3 {
    margin: 0 0 20px 0;
    font-size: 20px;
    font-weight: 700;
    color: #2d3748;
    padding-bottom: 10px;
    border-bottom: 2px solid #2d3748;
}

.specs-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 0;
}

.specs-list li {
    display: flex;
    justify-content: space-between;
    padding: 12px 15px;
    border-bottom: 2px solid #2d3748;
}

.specs-list li:last-child {
    border-bottom: 2px solid #2d3748;
}

.spec-label {
    font-weight: 600;
    color: #2d3748;
    min-width: 120px;
}

.spec-value {
    color: #2d3748;
    text-align: right;
    flex: 1;
}

/* Description */
.device-description {
    background: #2d3748;
    padding: 25px;
    border-radius: 12px;
    border: 2px solid #4a5568;
}

.device-description h3 {
    margin: 0 0 15px 0;
    font-size: 20px;
    font-weight: 700;
    color: #e2e8f0;
}

.device-description p {
    color: #cbd5e0;
    line-height: 1.7;
    margin: 0;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 15px;
    margin-top: 10px;
}

.btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px 30px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(40, 167, 69, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(108, 117, 125, 0.4);
}

/* Device Meta */
.device-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 15px;
    background: #2d3748;
    border-radius: 8px;
    font-size: 14px;
    color: #a0aec0;
}

.device-meta svg {
    flex-shrink: 0;
}

.device-meta span {
    font-weight: 500;
}

/* ============================================
   RESPONSIVE DESIGN - Tablet
   ============================================ */
@media (max-width: 1024px) {
    .inventory-view-container {
        max-width: 100%;
        margin: 15px;
        padding: 15px;
    }

    .device-detail-grid {
        gap: 30px;
    }

    .device-title {
        font-size: 28px;
    }

    .price-value {
        font-size: 32px;
    }
}

/* ============================================
   RESPONSIVE DESIGN - Mobile
   ============================================ */
@media (max-width: 768px) {
    .inventory-view-container {
        margin: 10px;
        padding: 10px;
        border-radius: 8px;
    }

    .inventory-view-container .container-content {
        padding: 15px;
    }

    /* Show category path above images on mobile */
    .category-path-wrapper {
        display: block;
        margin-bottom: 20px;
    }

    /* Hide the original category path in device-info-section on mobile */
    .device-info-section .category-path {
        display: none;
    }

    .device-detail-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }

    .device-image-section .image-container {
        padding: 15px;
    }

    .device-image-section img {
        max-height: 400px;
    }

    .thumbnail {
        width: 70px;
        height: 70px;
    }

    .image-thumbnails {
        gap: 8px;
    }

    .device-title,
    .device-storage,
    .device-carrier {
        font-size: 20px;
    }

    .deal-banner {
        padding: 10px 18px;
        font-size: 14px;
        gap: 8px;
    }

    .price-value {
        font-size: 28px;
    }

    .original-price-strike {
        font-size: 18px;
    }

    .device-price-box {
        padding: 15px;
    }

    .device-description-box {
        padding: 20px;
    }

    .device-description-box h3 {
        font-size: 18px;
    }

    .description-content {
        padding: 12px 0 0 0;
    }

    .description-content p {
        font-size: 14px;
    }

    .action-buttons {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .specs-list li {
        flex-direction: column;
        gap: 5px;
    }

    .spec-label {
        min-width: auto;
    }

    .spec-value {
        text-align: left;
    }

    .sold-overlay {
        font-size: 24px;
        padding: 15px 30px;
        letter-spacing: 2px;
    }

    .back-button {
        padding: 8px 16px;
        font-size: 14px;
    }
}

/* ============================================
   RESPONSIVE DESIGN - Small Mobile
   ============================================ */
@media (max-width: 480px) {
    .inventory-view-container {
        margin: 5px;
        padding: 5px;
    }

    .inventory-view-container .container-content {
        padding: 10px;
    }

    /* Ensure category path is shown above images */
    .category-path-wrapper {
        display: block;
        margin-bottom: 15px;
    }

    .category-path-wrapper .category-path {
        font-size: 12px;
    }

    /* Hide the original category path in device-info-section */
    .device-info-section .category-path {
        display: none;
    }

    .device-title,
    .device-storage,
    .device-carrier {
        font-size: 16px;
    }

    .deal-banner {
        padding: 8px 14px;
        font-size: 12px;
        gap: 6px;
    }

    .deal-banner svg {
        width: 16px;
        height: 16px;
    }

    .price-value {
        font-size: 24px;
    }

    .original-price-strike {
        font-size: 16px;
    }

    .thumbnail {
        width: 60px;
        height: 60px;
    }

    .image-thumbnails {
        gap: 6px;
    }

    .device-specifications,
    .device-description {
        padding: 15px;
    }

    .device-description-box {
        padding: 15px;
    }

    .device-description-box h3 {
        font-size: 16px;
    }

    .description-content {
        padding: 10px 0 0 0;
    }

    .description-content p {
        font-size: 13px;
    }

    .device-specifications h3,
    .device-description h3 {
        font-size: 18px;
    }

    .sold-overlay {
        font-size: 20px;
        padding: 12px 24px;
        letter-spacing: 1px;
    }

    .availability-badge {
        padding: 10px 16px;
        font-size: 13px;
    }
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
    .back-link,
    .action-buttons {
        display: none;
    }

    .inventory-view-container {
        box-shadow: none;
        margin: 0;
    }

    .device-detail-grid {
        grid-template-columns: 1fr;
    }

    .sold-overlay {
        background: rgba(220, 53, 69, 0.3);
    }
}

/* ============================================
   Accessibility Enhancements
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .deal-banner {
        animation: none;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .device-price-box {
        border: 2px solid #000;
    }

    .availability-badge {
        border-width: 3px;
    }

    .btn {
        border: 2px solid #000;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .inventory-view-container {
        background: rgba(30, 30, 30, 0.98);
    }

    .device-title,
    .device-storage,
    .device-carrier {
        color: #000000;
    }

    .device-meta {
        background: #2d3748;
        color: #e2e8f0;
    }

    .device-specifications,
    .device-description-box,
    .device-price-box {
        background: #ffffff;
        border-color: #2d3748;
    }

    .specs-list li {
        border-bottom-color: #2d3748;
    }

    .spec-label,
    .spec-value,
    .device-specifications h3,
    .device-description-box h3,
    .description-content p,
    .price-label,
    .price-value {
        color: #2d3748;
    }
}
