@charset "utf-8";
/* CSS Document */
/* ======= General Page Styling ======= */
body {
    background: #f5f5f5;
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
}

/* ======= Animations ======= */
@keyframes fadeIn {
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes fadeSlideUp {
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes fadeZoomIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes fadeInOverlay {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

/* ======= Container ======= */
.container {
    width: 90%; 
    max-width: 800px; 
    margin: 30px auto;
    background: #fff; 
    padding: 20px; 
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2); 
    animation: fadeIn 0.8s ease-in-out;
}

/* ======= Apply universal animation to all content ======= */
.container > *, .product-detail > * {
    opacity: 0;
    animation: fadeSlideUp 0.8s ease-out forwards;
}

/* Staggered delays for smooth appearance */
.container > *:nth-child(1),
.product-detail > *:nth-child(1) { animation-delay: 0.1s; }
.container > *:nth-child(2),
.product-detail > *:nth-child(2) { animation-delay: 0.2s; }
.container > *:nth-child(3),
.product-detail > *:nth-child(3) { animation-delay: 0.3s; }
.container > *:nth-child(4),
.product-detail > *:nth-child(4) { animation-delay: 0.4s; }
.container > *:nth-child(5),
.product-detail > *:nth-child(5) { animation-delay: 0.5s; }
.container > *:nth-child(6),
.product-detail > *:nth-child(6) { animation-delay: 0.6s; }

/* ======= Headings ======= */
h1, h2, h3 {
    text-align: center;
}

/* ======= Tables ======= */
table {
    width: 80%;
    margin: 10px auto;
    border-collapse: collapse;
}

table, th, td {
    border: 1px solid #ddd;
}

th, td {
    padding: 10px;
    text-align: center;
}

th {
    background: #f4f4f4;
}

tr:hover {
    background: #f9f9f9;
    transition: background 0.3s ease;
}

/* ======= Buttons ======= */
a.button, button {
    padding: 5px 10px;
    background: #4CAF50;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    display: inline-block;
    transition: transform 0.2s ease, background 0.3s ease;
}

a.button:hover, button:hover {
    background: #45a049;
    transform: scale(1.05);
}

/* ======= Footer ======= */
footer {
    background: #333;
    color: #fff;
    text-align: center;
    padding: 15px;
    position: relative;
    bottom: 0;
    width: 100%;
}

/* ======= Product Detail ======= */
.product-detail {
    max-width: 800px;
    margin: auto;
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* Align gallery left */
.gallery {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: flex-start;
}

.gallery .image-container {
    position: relative;
    width: 400px;
    height: 400px;
    border-radius: 8px;
    overflow: hidden;
    cursor: zoom-in;
    flex-shrink: 0;
}

.gallery img#mainImage {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    opacity: 0;
    transform: scale(0.98);
    animation: fadeZoomIn 0.5s ease-out forwards;
    transition: transform 0.4s ease;
}

.gallery .image-container:hover img#mainImage {
    transform: scale(1.05);
}

/* Zoom result box */
.zoom-result {
    display: none;
    position: absolute;
    top: 0;
    left: 420px;
    width: 400px;
    height: 400px;
    border: 1px solid #ccc;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 0 10px rgba(0,0,0,0.2);
    background-repeat: no-repeat;
    background-size: 800px 800px;
    z-index: 10;
}

/* Arrows */
.arrow {
    background: rgba(0,0,0,0.5);
    color: #fff;
    padding: 10px;
    border-radius: 50%;
    cursor: pointer;
    user-select: none;
    font-size: 24px;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    transition: background 0.3s ease;
}

.arrow:hover {
    background: rgba(0,0,0,0.7);
}

.arrow.left { left: 0; }
.arrow.right { right: 0; }

.price {
    font-size: 1.2em;
    font-weight: bold;
    color: #e67e22;
    margin-top: 20px;
}

.btn {
    background: #27ae60;
    color: #fff;
    padding: 10px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 15px;
    transition: background 0.3s ease;
}

.btn:hover {
    background: #219150;
}

.back-btn {
    background: #555;
    color: #fff;
    padding: 8px 12px;
    text-decoration: none;
    border-radius: 5px;
    display: inline-block;
    margin-top: 25px;
    transition: background 0.3s ease;
}

.back-btn:hover {
    background: #333;
}

/* Full-screen zoom overlay */
.zoom-overlay {
    display: none;
    position: fixed;
    top: 0; 
    left: 0; 
    width: 100vw; 
    height: 100vh;
    background: rgba(0,0,0,0.9);
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.zoom-overlay img {
    max-width: 90%;
    max-height: 90%;
    box-shadow: 0 0 20px rgba(255,255,255,0.3);
    border-radius: 8px;
    animation: fadeInOverlay 0.4s ease-out;
}

.zoom-overlay span {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 30px;
    color: white;
    cursor: pointer;
    user-select: none;
    font-weight: bold;
}
