/* ==========================================
   MOBILE MENU IMPROVEMENTS
   ========================================== */

/* Enhanced mobile navigation */
@media (max-width: 991px) {
    .navbar-collapse {
        background: #000;
        margin-top: 10px;
        border-radius: 8px;
        padding: 10px 0;
    }

    .navbar-nav .nav-link {
        padding: 12px 20px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .navbar-nav .nav-link:hover {
        background: rgba(255, 153, 0, 0.1);
    }

    /* Better dropdown styling */
    .navbar-nav .dropdown-menu {
        background: rgba(35, 47, 62, 0.95);
        border: none;
        margin-left: 15px;
    }

    .navbar-nav .dropdown-item {
        color: white;
        padding: 10px 15px;
    }

    .navbar-nav .dropdown-item:hover {
        background: rgba(255, 153, 0, 0.2);
    }
}

/* ==========================================
   PRODUCT PAGE ENHANCEMENTS
   ========================================== */

/* Image Zoom Container */
.product-image-zoom {
    position: relative;
    overflow: hidden;
    cursor: zoom-in;
    border-radius: 8px;
}

.product-image-zoom img {
    transition: transform 0.3s ease;
    max-width: 100%;
    height: auto;
    display: block;
}

.product-image-zoom:hover img {
    transform: scale(1.5);
}

/* Zoom lens overlay */
.zoom-lens {
    position: absolute;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2);
    width: 100px;
    height: 100px;
    pointer-events: none;
    display: none;
    background: rgba(255, 255, 255, 0.3);
}

.product-image-zoom:hover .zoom-lens {
    display: block;
}

/* Lightbox Gallery */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.lightbox-overlay.active {
    display: flex;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90vh;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: absolute;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.lightbox-close {
    top: 20px;
    right: 20px;
}

.lightbox-prev {
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-next {
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(255, 153, 0, 0.9);
}

.lightbox-next:hover,
.lightbox-prev:hover {
    transform: translateY(-50%) scale(1.1);
}

.lightbox-close:hover {
    transform: scale(1.1);
}

.lightbox-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
}

/* Star Rating Display */
.star-rating {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: 18px;
}

.star-rating .star {
    color: #ddd;
    transition: color 0.2s ease;
}

.star-rating .star.filled {
    color: #ffa500;
    text-shadow: 0 0 2px rgba(255, 165, 0, 0.5);
}

.star-rating .star.half {
    position: relative;
    color: #ddd;
}

.star-rating .star.half::before {
    content: '★';
    position: absolute;
    left: 0;
    color: #ffa500;
    width: 50%;
    overflow: hidden;
    text-shadow: 0 0 2px rgba(255, 165, 0, 0.5);
}

.star-rating-text {
    margin-left: 8px;
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.star-rating-link {
    color: var(--amazon-blue);
    text-decoration: none;
}

.star-rating-link:hover {
    text-decoration: underline;
}

/* Stock Countdown */
.stock-countdown {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: linear-gradient(135deg, #fff5f5 0%, #ffe8e8 100%);
    border-left: 4px solid #ef4444;
    border-radius: 6px;
    margin: 12px 0;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
    }

    50% {
        box-shadow: 0 0 0 4px rgba(239, 68, 68, 0);
    }
}

.stock-countdown-icon {
    color: #ef4444;
    font-size: 20px;
}

.stock-countdown-text {
    font-size: 14px;
    font-weight: 600;
    color: #dc2626;
}

/* Sticky Add to Cart (Mobile) */
.sticky-add-to-cart {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    padding: 12px 20px;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1020;
    display: none;
    align-items: center;
    justify-content: space-between;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.sticky-add-to-cart.show {
    display: flex;
    transform: translateY(0);
}

.sticky-add-to-cart-price {
    font-size: 20px;
    font-weight: 700;
    color: var(--amazon-blue);
}

.sticky-add-to-cart-button {
    background: var(--amazon-orange);
    color: #111;
    border: none;
    padding: 12px 28px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.sticky-add-to-cart-button:hover {
    background: #e68900;
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.sticky-add-to-cart-button:active {
    transform: scale(0.98);
}

@media (min-width: 768px) {
    .sticky-add-to-cart {
        display: none !important;
    }
}

/* Recently Viewed Products */
.recently-viewed-section {
    margin-top: 50px;
    padding: 40px 0;
    background: linear-gradient(180deg, #f8f9fa 0%, #ffffff 100%);
    border-top: 1px solid #e0e0e0;
}

.recently-viewed-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.recently-viewed-header h3 {
    font-size: 24px;
    font-weight: 600;
    margin: 0;
    color: #333;
}

.recently-viewed-header i {
    color: var(--amazon-blue);
    font-size: 20px;
}

.recently-viewed-track {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 10px 0 20px 0;
}

.recently-viewed-track::-webkit-scrollbar {
    height: 8px;
}

.recently-viewed-track::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.recently-viewed-track::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.5);
    border-radius: 4px;
}

.recently-viewed-track::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.8);
}

.recently-viewed-item {
    min-width: 200px;
    background: white;
    border-radius: 8px;
    padding: 12px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #e0e0e0;
    text-decoration: none;
    color: inherit;
    display: block;
}

.recently-viewed-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    border-color: var(--amazon-blue);
}

.recently-viewed-item img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 10px;
}

.recently-viewed-item-title {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.recently-viewed-item-price {
    font-size: 16px;
    font-weight: 700;
    color: var(--amazon-blue);
}

/* Product thumbnail gallery */
.product-thumbnails {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.product-thumbnail {
    width: 80px;
    height: 80px;
    border: 2px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
}

.product-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-thumbnail:hover,
.product-thumbnail.active {
    border-color: var(--amazon-orange);
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}