/* General Styles */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    min-height: 100vh;          /* Helps with footer positioning */
    display: flex;
    flex-direction: column;
}

header {
    background-color: #333;
    color: white;
    padding: 15px 20px;
    text-align: center;
}

.main-nav {
    list-style: none;
    padding: 0;
    margin: 10px 0;
}

.main-nav li {
    display: inline;
    margin: 0 15px;
}

.main-nav a {
    color: white;
    text-decoration: none;
    font-weight: bold;
}

.main-nav a:hover {
    text-decoration: underline;
}

footer {
    background-color: #333;
    color: white;
    text-align: center;
    padding: 15px;
    margin-top: auto;           /* Pushes footer to bottom when content is short */
}

/* Product List - Flexbox (tableless) */
.product-list {
    padding: 30px 20px;
}

.products {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
}

.product {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    width: 220px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}

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

.product img {
    width: 160px;
    height: 160px;
    object-fit: contain;
    margin-bottom: 10px;
}

.product a {
    text-decoration: none;
    color: #333;
}

.product h3 {
    margin: 10px 0 5px;
    font-size: 1.1em;
}

.product p {
    color: #e44d26;
    font-weight: bold;
    margin: 5px 0;
}

/* Shopping Cart */
.cart-container {
    position: relative;
    display: inline-block;
    float: right;
    margin-top: 10px;
}

.cart-toggle-input {
    display: none;
}

.cart-icon {
    cursor: pointer;
    padding: 10px 15px;
    background-color: #555;
    border-radius: 4px;
    color: white;
    font-weight: bold;
    user-select: none;
}

.shopping-list {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background: white;
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 20px;
    width: 280px;
    z-index: 1000;              
    box-shadow: 0 8px 16px rgba(0,0,0,0.15);
    color: #333;               
    font-size: 0.95em;
}

.shopping-list h2 {
    margin-top: 0;
    font-size: 1.3em;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

/* Hover on desktop/large screens */
@media (min-width: 769px) {
    .cart-container:hover .shopping-list {
        display: block;
    }
}

/* Click/toggle on all screens (especially mobile) */
#cart-toggle:checked ~ .shopping-list {
    display: block;
}

/* Mobile hint */
@media (max-width: 768px) {
    .cart-icon::after {
        content: " (tap to open/close)";
        font-size: 0.85em;
        opacity: 0.8;
    }
}

.shopping-list ul {
    list-style: none;
    padding: 0;
    margin: 15px 0;
}

.shopping-list li {
    margin: 12px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.shopping-list input[type="number"] {
    width: 60px;
    padding: 5px;
    text-align: center;
}

button {
    background: #28a745;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.2s, transform 0.1s;
}

button:hover {
    background: #218838;
}

button:active {
    transform: scale(0.97);
}

/* Product Details Page */
.product-details {
    padding: 40px 20px;
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
}

.product-details h2 {
    margin-bottom: 20px;
}

.product-details p {
    font-size: 1.1em;
    line-height: 1.6;
    margin: 20px 0;
}

.product-details .price {
    font-size: 1.8em;
    color: #e44d26;
    font-weight: bold;
    margin: 20px 0;
}

.image-slider {
    position: relative;
    width: 100%;
    max-width: 500px;
    height: 500px;
    margin: 0 auto 30px;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.slides {
    display: flex;
    height: 100%;
    transition: transform 0.5s ease;
}

.slide {
    min-width: 100%;
    height: 100%;
}

.slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

input[name="slide"] {
    display: none;
}

#slide1:checked ~ .slides { transform: translateX(0); }
#slide2:checked ~ .slides { transform: translateX(-100%); }
#slide3:checked ~ .slides { transform: translateX(-200%); }

.navigation {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
}

.navigation label {
    width: 14px;
    height: 14px;
    background: rgba(255,255,255,0.6);
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.3s;
}

.navigation label:hover {
    background: white;
}

#slide1:checked ~ .navigation label[for="slide1"],
#slide2:checked ~ .navigation label[for="slide2"],
#slide3:checked ~ .navigation label[for="slide3"] {
    background: #333;
}