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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f9f9f9;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Notification */
.add-to-cart-notification {
    display: none;
    position: fixed;
    top: 20px;
    right: 20px;
    background: #4CAF50;
    color: white;
    padding: 15px 20px;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
    animation: slideIn 0.5s, fadeOut 0.5s 2.5s;
}

@keyframes slideIn {
    from { right: -100px; opacity: 0; }
    to { right: 20px; opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* Error Message */
.error-message {
    color: #d32f2f;
    background: #ffebee;
    padding: 10px 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    border-left: 4px solid #d32f2f;
}

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

/* Product Image Container */
.product-image-container {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

/* Main Image */
.main-image-wrapper {
    width: 100%;
    height: 400px;
    margin-bottom: 15px;
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #f9f9f9;
    cursor: zoom-in;
}

.main-product-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.main-product-image:hover {
    transform: scale(1.02);
}

/* Thumbnail Gallery */
.thumbnail-gallery {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.thumbnail-item {
    width: 70px;
    height: 70px;
    border: 2px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
}

.thumbnail-item:hover {
    border-color: #999;
    transform: translateY(-3px);
}

.product-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9);
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    display: block;
    margin: 60px auto;
    max-width: 90%;
    max-height: 80vh;
    border-radius: 4px;
    animation: zoomIn 0.3s;
}

@keyframes zoomIn {
    from { transform: scale(0.9); }
    to { transform: scale(1); }
}

.close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
    text-shadow: 0 0 5px rgba(0,0,0,0.5);
}

.close:hover {
    color: #ccc;
    transform: scale(1.1);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .main-image-wrapper {
        height: 300px;
    }
    
    .thumbnail-item {
        width: 60px;
        height: 60px;
    }
    
    .modal-content {
        max-width: 95%;
        max-height: 70vh;
    }
    
    .close {
        top: 15px;
        right: 20px;
        font-size: 35px;
    }
}

/* Main Image */
.main-image-wrapper {
    width: 100%;
    height: 400px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    background: #fff;
    border-radius: 8px;
}

.main-product-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    cursor: zoom-in;
    transition: transform 0.3s;
}

.main-product-image:hover {
    transform: scale(1.02);
}
/* Thumbnail Gallery Styles */
.thumbnail-gallery {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.thumbnail-item {
    width: 80px;
    height: 80px;
    border: 1px solid #ddd;
    cursor: pointer;
    transition: all 0.3s ease;
}

.thumbnail-item:hover {
    border-color: #333;
}

.product-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    padding-top: 50px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9);
}

.modal-content {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 700px;
    animation: zoom 0.3s;
}

@keyframes zoom {
    from {transform: scale(0.8);}
    to {transform: scale(1);}
}

.close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}

.close:hover {
    color: #bbb;
}

/* Product Info */
.product-title {
    font-size: 28px;
    margin-bottom: 15px;
    color: #222;
}

.price-availability {
    margin-bottom: 20px;
}

.price {
    font-size: 24px;
    font-weight: bold;
    color: #e53935;
    margin-bottom: 10px;
}

.stock-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
}

.in-stock {
    color: #388e3c;
}

.out-of-stock {
    color: #d32f2f;
}

/* Quantity Selector */
.quantity-selector {
    margin: 20px 0;
}

.quantity-input-group {
    display: flex;
    align-items: center;
    margin-top: 8px;
}

.quantity-btn {
    width: 40px;
    height: 40px;
    background: #f0f0f0;
    border: 1px solid #ddd;
    font-size: 18px;
    cursor: pointer;
    transition: background 0.3s;
}

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

.quantity-input {
    width: 60px;
    height: 40px;
    text-align: center;
    border: 1px solid #ddd;
    border-left: none;
    border-right: none;
    font-size: 16px;
    -moz-appearance: textfield;
}

.quantity-input::-webkit-outer-spin-button,
.quantity-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Add to Cart Button */
.btn-add-to-cart {
    width: 100%;
    padding: 12px;
    background: #e53935;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-add-to-cart:hover {
    background: #c62828;
}

/* Product Descriptions */
.product-description {
    margin: 25px 0;
}

.product-description h3 {
    font-size: 20px;
    margin-bottom: 10px;
    color: #333;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
}

/* Product Specs */
.product-specs {
    margin: 25px 0;
}

.product-specs h3 {
    font-size: 20px;
    margin-bottom: 10px;
    color: #333;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
}

.specs-list {
    list-style: none;
}

.specs-list li {
    margin-bottom: 8px;
    display: flex;
    gap: 5px;
}

.specs-list strong {
    min-width: 80px;
    display: inline-block;
}

/* Product Videos */
.product-videos {
    margin: 40px 0;
}

.section-title {
    font-size: 22px;
    margin-bottom: 20px;
    color: #333;
}

.videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.video-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    border-radius: 8px;
}

.video-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.video-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Product Not Found */
.product-not-found {
    text-align: center;
    padding: 50px 20px;
}

.product-not-found h2 {
    font-size: 28px;
    margin-bottom: 15px;
    color: #333;
}

.product-not-found p {
    font-size: 18px;
    margin-bottom: 25px;
    color: #666;
}

.btn-browse {
    display: inline-block;
    padding: 12px 25px;
    background: #e53935;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 16px;
    transition: background 0.3s;
}

.btn-browse:hover {
    background: #c62828;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    padding-top: 50px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9);
}

.modal-content {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 700px;
    animation: zoom 0.3s;
}

@keyframes zoom {
    from { transform: scale(0.8); }
    to { transform: scale(1); }
}

.close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}

.close:hover {
    color: #bbb;
}

/* Responsive Design */
@media (max-width: 768px) {
    .product-detail {
        flex-direction: column;
    }
    
    .main-image-wrapper {
        height: 300px;
    }
    
    .product-title {
        font-size: 24px;
    }
    
    .price {
        font-size: 22px;
    }
    
    .thumbnail-gallery {
        justify-content: center;
    }
    
    .videos-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        width: 95%;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 15px;
    }
    
    .main-image-wrapper {
        height: 250px;
    }
    
    .thumbnail-item {
        width: 60px;
        height: 60px;
    }
    
    .product-title {
        font-size: 22px;
    }
    
    .btn-add-to-cart {
        padding: 10px;
        font-size: 15px;
    }
}