@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;600;800&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Manrope', sans-serif;
}

body {
    background-color: #f8f9fa;
    color: #111;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* --- Navigation --- */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 50px;
    background: white;
    border-bottom: 1px solid #eee;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -1px;
}

.cart-icon {
    position: relative;
    cursor: pointer;
    font-size: 1.2rem;
}

#cart-count {
    position: absolute;
    top: -8px;
    right: -10px;
    background: #ef4444;
    color: white;
    font-size: 0.7rem;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* --- Product Layout --- */
.product-container {
    display: flex;
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    align-items: center;
    padding: 50px;
    gap: 80px;
}

.product-gallery {
    flex: 1;
    display: flex;
    justify-content: center;
}

.main-image img {
    width: 100%;
    max-width: 500px;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    transition: opacity 0.2s ease;
}

/* --- Details Section --- */
.product-details {
    flex: 1;
}

.tag {
    background: #e0f2fe;
    color: #0284c7;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
}

h1 {
    font-size: 3.5rem;
    margin: 15px 0;
    line-height: 1;
    letter-spacing: -1px;
}

.price {
    font-size: 1.5rem;
    color: #4b5563;
    font-weight: 600;
    margin-bottom: 20px;
}

.description {
    color: #6b7280;
    line-height: 1.7;
    margin-bottom: 30px;
}

/* --- Color Selector --- */
.color-selection {
    margin-bottom: 30px;
}

.color-selection p {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.colors {
    display: flex;
    gap: 15px;
}

.color-circle {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform 0.2s;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.color-circle:hover {
    transform: scale(1.1);
}

.color-circle.active {
    border-color: #111;
    transform: scale(1.1);
}

/* --- Actions --- */
.actions {
    display: flex;
    gap: 15px;
    margin-bottom: 40px;
}

.add-to-cart {
    flex: 1;
    background: #111;
    color: white;
    border: none;
    padding: 15px;
    border-radius: 8px;
    font-weight: 800;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s;
}

.add-to-cart:hover {
    background: #333;
}

.wishlist {
    width: 50px;
    background: white;
    border: 2px solid #eee;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.2rem;
    color: #333;
    transition: all 0.2s;
}

.wishlist:hover {
    border-color: #ef4444;
    color: #ef4444;
}

/* --- Accordion --- */
.spec-item {
    border-bottom: 1px solid #eee;
}

.spec-header {
    display: flex;
    justify-content: space-between;
    padding: 15px 0;
    cursor: pointer;
    font-weight: 600;
}

.spec-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    color: #6b7280;
    font-size: 0.9rem;
}

.spec-item.active .spec-content {
    max-height: 100px;
    padding-bottom: 15px;
}

.spec-item.active i {
    transform: rotate(45deg);
    transition: transform 0.3s;
}

/* --- Mobile Responsiveness --- */
@media (max-width: 900px) {
    .product-container {
        flex-direction: column;
        padding: 20px;
        gap: 40px;
    }
    
    body {
        height: auto;
    }
    
    h1 { font-size: 2.5rem; }
}

/* --- Cart Drawer Styles --- */
.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 998;
    opacity: 0;
    pointer-events: none; /* Click through when hidden */
    transition: opacity 0.3s ease;
}

.cart-overlay.open {
    opacity: 1;
    pointer-events: all;
}

.cart-sidebar {
    position: fixed;
    top: 0;
    right: -400px; /* Hidden off-screen */
    width: 400px;
    height: 100%;
    background: white;
    z-index: 999;
    box-shadow: -5px 0 30px rgba(0,0,0,0.1);
    transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1); /* Smooth Apple-like ease */
    display: flex;
    flex-direction: column;
}

.cart-sidebar.open {
    right: 0;
}

.cart-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.close-cart {
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
}

.cart-items {
    flex: 1; /* Takes up remaining space */
    overflow-y: auto;
    padding: 20px;
}

/* Individual Item in Cart */
.cart-item {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    align-items: center;
}

.cart-item img {
    width: 70px;
    height: 70px;
    border-radius: 10px;
    object-fit: cover;
}

.item-details h4 {
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.item-details p {
    font-size: 0.8rem;
    color: #666;
}

.cart-footer {
    padding: 20px;
    border-top: 1px solid #eee;
    background: #f9f9f9;
}

.total {
    display: flex;
    justify-content: space-between;
    font-weight: 800;
    font-size: 1.2rem;
    margin-bottom: 15px;
}

.checkout-btn {
    width: 100%;
    background: #111;
    color: white;
    padding: 15px;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
}

.checkout-btn:hover {
    background: #333;
}

/* Mobile Fix */
@media (max-width: 500px) {
    .cart-sidebar { width: 100%; }
}

/* --- Related Products --- */
.related-products {
    max-width: 1200px;
    margin: 0 auto;
    padding: 80px 50px;
    border-top: 1px solid #eee;
}

.related-products h2 {
    font-size: 2rem;
    margin-bottom: 40px;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.product-card {
    background: white;
    padding: 20px;
    border-radius: 15px;
    transition: transform 0.3s;
    cursor: pointer;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
}

.card-image {
    position: relative;
    height: 200px;
    margin-bottom: 15px;
    overflow: hidden;
    border-radius: 10px;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: white;
    padding: 5px 10px;
    font-size: 0.7rem;
    font-weight: bold;
    border-radius: 4px;
}

.product-card h3 { font-size: 1.1rem; margin-bottom: 5px; }
.product-card p { color: #666; font-size: 0.9rem; margin-bottom: 15px; }

.btn-small {
    padding: 8px 20px;
    border: 1px solid #ddd;
    background: transparent;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-small:hover {
    background: #111;
    color: white;
    border-color: #111;
}

/* --- Product Modal Styles --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    background: white;
    width: 90%;
    max-width: 800px;
    border-radius: 15px;
    padding: 30px;
    position: relative;
    transform: translateY(50px);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 2rem;
    cursor: pointer;
    color: #666;
    line-height: 1;
}

.modal-body {
    display: flex;
    gap: 30px;
    align-items: center;
}

.modal-image { flex: 1; }

.modal-image img {
    width: 100%;
    border-radius: 10px;
    object-fit: cover;
}

.modal-details { flex: 1.2; }

.modal-details h2 { font-size: 2rem; margin-bottom: 10px; }

/* Mobile Modal */
@media (max-width: 768px) {
    .modal-body { flex-direction: column; }
    .modal-content { height: 90vh; overflow-y: scroll; }
}