/* Root Variables */
:root {
    --primary-color: #003049;
    --secondary-color: #FCA311;
    --accent-color: #FCA311;
    --text-color: #333;
    --light-gray: #f5f5f5;
    --border-color: #ddd;
}

/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
}

/* Navigation */
nav {
    padding: 10px 20px;
    background-color: #fff;
    border-bottom: 1px solid var(--border-color);
}

nav a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.9em;
}

/* Container */
.container {
    padding: 20px 2%;
    /* max-width: 1200px; */
    margin: 0 auto;
}

/* Product Detail Section */
.product-detail {
    display: flex;
    gap: 30px;
    margin-bottom: 20px;
}

.product-images {
    flex: 1;
    position: relative;
    width: 46%;
}

.main-image-container {
    position: relative;
    width: 100%;
    height: 400px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 10px;
}

.main-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* Thumbnail Container with Carousel */
.thumbnail-container {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.thumbnail-wrapper {
    display: flex;
    gap: 39px;
    transition: transform 0.3s ease;
    width: max-content;
}

.thumbnail-wrapper img {
    width: 150px;
    height: 150px;
    object-fit: cover;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border 0.3s ease;
    flex-shrink: 0;
}

.thumbnail-wrapper img.active {
    border: 2px solid var(--accent-color);
}

/* Navigation Arrows */
.thumbnail-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    z-index: 10;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.thumbnail-nav:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.7);
}

.thumbnail-nav.prev {
    left: -15px;
}

.thumbnail-nav.next {
    right: -15px;
}

.thumbnail-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Hide navigation if 3 or fewer images */
.thumbnail-container:has(.thumbnail-wrapper img:nth-child(-n+3):last-child) .thumbnail-nav {
    display: none;
}

/* Zoom Lens Effect */
.zoom-lens {
    position: absolute;
    width: 40%;   
    height: 50%;
    border-radius: 5%;
    border: 2px solid var(--border-color);
    pointer-events: none;
    opacity: 0; 
    background-repeat: no-repeat;
    background-size: 200%;
    background-position: center;
}

.product-info {
    flex: 1;
}

.product-info h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    color: var(--text-color);
}

.price {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px 0;
    font-size: 20px;
}

.price .current {
    font-size: 30px;
    color: var(--accent-color);
    /* font-weight: bold; */
}

.price .original {
    text-decoration: line-through;
    color: #666;
    margin-left: 10px;
}

.price .offer {
    color: var(--accent-color);
    /* color: white; */
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.9em;
}

.rating {
    margin-bottom: 10px;
    color: var(--accent-color);
}

.rating .stock {
    color:var(--text-color);
    margin-left: 10px;
    font-size: 0.9em;
}

.description {
    margin-bottom: 20px;
    color: #666;
    font-size: 24px;
}

.buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.add-to-cart, .buy-now {
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    height: 70px;
    width: 200px;
    font-size: 24px;
}

.add-to-cart {
    background: var(--accent-color);
    color: white;
}

.buy-now {
    background: var(--primary-color);
    color: white;
}

.sku, .category {
    font-size: 1.3em;
    color: #666;
    margin-bottom: 5px;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.tab {
    padding: 10px 20px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    background: white;
    cursor: pointer;
}

.tab.active {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

.tab-content {
    display: none;
    padding: 20px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.tab-content.active {
    display: block;
}

/* Related Products */
.related-products {
    margin-top: 40px;
}

.related-products h2 {
    font-size: 1.5em;
    margin-bottom: 20px;
}

.product-grid {
    display: flex;
    overflow-x: auto;
    gap: 20px;
    padding-bottom: 10px;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}

.product-grid::-webkit-scrollbar {
    height: 8px;
}

.product-grid::-webkit-scrollbar-thumb {
    background: var(--accent-color);
    border-radius: 4px;
}

.product-grid::-webkit-scrollbar-track {
    background: var(--light-gray);
}

.product-card {
    flex: 0 0 200px; 
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    transition: transform 0.3s;
    cursor: pointer;
    margin-top: 5px;
}

.product-card:hover {
    transform: translateY(-5px);
}

.product-card img {
    width: 100%;
    height: 150px;
    object-fit: contain;
    margin-bottom: 10px;
}

.product-card h3 {
    font-size: 1em;
    margin-bottom: 5px;
}

.product-card p {
    font-size: 1em;
    color: var(--accent-color);
    margin-bottom: 5px;
}

.product-name {
  width: 180px; /* match your card width */
  overflow: hidden;
  white-space: nowrap;
  position: relative;
}

.product-name span {
  display: inline-block;
  transition: transform 5s linear; /* smooth sliding */
}

/* Slide when hovered */
.product-name.scrollable:hover span {
  transform: translateX(-90%);
}

/*Related Price & Offer */
.relatedprice .current {
    font-size: 1em;
    color: var(--accent-color);
    /* font-weight: bold; */
}

.relatedprice .original {
    text-decoration: line-through;
    color: #666;
    margin-left: 10px;
}

.relatedprice .offer {
    color: var(--accent-color);
    /* color: white; */
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.9em;
}

.product-card .rating {
    font-size: 0.9em;
    color: var(--accent-color);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .product-detail {
        flex-direction: column;
    }
    .main-image-container {
        height: 300px;
    }
    .zoom-result {
        display: none;
    }
}

@media (max-width: 768px) {
    .product-detail {
        flex-direction: column;
    }
    .main-image-container {
        height: 250px;
    }
    .thumbnail-wrapper img {
        width: 80px;
        height: 80px;
    }
    .product-card {
        flex: 0 0 150px;
    }
    .product-card img {
        height: 120px;
    }
}

@media (max-width: 480px) {
    .main-image-container {
        height: 200px;
    }
    .thumbnail-wrapper img {
        width: 60px;
        height: 60px;
    }
    .product-card {
        flex: 0 0 150px;
    }
    .product-card img {
        height: 100px;
    }
    .buttons {
        flex-direction: column;
    }
    .add-to-cart, .buy-now {
        width: 100%;
    }
    .product-info h1 {
        font-size: 1.8em;
    }
    .description {
        font-size: 18px;
    }
    .sku, .category {
        font-size: 1em;
    }
}

.quantity {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 25px 0;
}

.quantity label {
    font-weight: bold;
    font-size: 16px;
}

.quantity-selector {
    display: flex;
    align-items: center;
    border: 1px solid #ccc;
    border-radius: 4px;
    overflow: hidden;
}

.quantity-btn {
    background: #f0f0f0;
    border: none;
    padding: 5px 10px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
}

.quantity-btn:hover {
    background: #ddd;
}

#quantity-input {
    width: 40px;
    text-align: center;
    border: none;
    border-left: 1px solid #ccc;
    border-right: 1px solid #ccc;
    padding: 5px;
    font-size: 16px;
}

#quantity-input:focus {
    outline: none;
}

.wishlist-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 24px;
    color: #555;
}
  
.wishlist-btn.active {
    color: red;
}

.category .offer{
    color: var(--border-color);
}