:root {
    --primary: #FFC1E3;
    /* Soft Pink */
    --primary-dark: #FF9ECA;
    --secondary: #E0CCFF;
    /* Soft Lavender */
    --accent: #FFB7B2;
    /* Peach/Coral */
    --bg-color: #FFF5FA;
    /* Very light pink background */
    --white: #ffffff;
    --text-main: #555555;
    --text-light: #888888;
    --shadow: 0 4px 15px rgba(255, 193, 227, 0.4);
    --border-radius: 15px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
}

/* Header */
.main-header {
    background-color: var(--white);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.menu-btn {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 5px;
    z-index: 1001;
    /* Above sidebar backdrop if needed, but sidebar is z-1000 */
}

.menu-btn span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--primary-dark);
    border-radius: 5px;
    transition: 0.3s;
}

.logo {
    height: 60px;
    /* Slight increase for better visibility */
    width: auto;
    object-fit: contain;
}

.brand-name {
    font-weight: 600;
    font-size: 1.5rem;
    color: var(--primary-dark);
    letter-spacing: 1px;
}

.search-bar {
    position: relative;
    width: 300px;
}

.search-bar input {
    width: 100%;
    padding: 0.8rem 2.5rem 0.8rem 1.2rem;
    border: 2px solid var(--secondary);
    border-radius: 50px;
    outline: none;
    font-family: inherit;
    transition: 0.3s;
    background: #FAFAFF;
}

.search-bar input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 8px var(--primary);
}

.search-bar button {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--primary-dark);
    font-size: 1.2rem;
    cursor: pointer;
}

/* Layout */
.container {
    display: flex;
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 2rem;
    gap: 2rem;
}

/* Sidebar (Sliding) */
.sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    /* Hidden by default */
    width: 280px;
    height: 100vh;
    background: var(--white);
    padding: 80px 2rem 2rem 2rem;
    /* Top padding to avoid logo if under, but we'll put it on top layer or lower */
    box-shadow: 2px 0 15px rgba(0, 0, 0, 0.1);
    transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999;
    overflow-y: auto;
}

.sidebar.active {
    left: 0;
}

/* Overlay */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(2px);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: 0.3s;
}

.overlay.active {
    opacity: 1;
    visibility: visible;
}

.sidebar-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--bg-color);
    padding-bottom: 0.5rem;
}

.sidebar h3 {
    margin: 0;
    color: var(--primary-dark);
    font-size: 1.2rem;
    border: none;
    padding: 0;
}

.close-btn-dark {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--primary-dark);
    cursor: pointer;
    line-height: 1;
}

.sidebar ul {
    list-style: none;
}

.sidebar li {
    padding: 1rem;
    margin-bottom: 0.5rem;
    border-radius: 10px;
    cursor: pointer;
    transition: 0.3s;
    color: var(--text-main);
}

.sidebar li:hover,
.sidebar li.active {
    background-color: var(--bg-color);
    color: var(--primary-dark);
    font-weight: 500;
}

/* Main Content */
.main-content {
    flex: 1;
}

.main-content h2 {
    margin-bottom: 1.5rem;
    color: var(--text-main);
    font-weight: 600;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 2rem;
}

/* Product Card */
.product-card {
    background: var(--white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.03);
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
}

.card-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background-color: #fafafa;
}

.card-body {
    padding: 1.2rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.card-category {
    font-size: 0.8rem;
    color: var(--primary-dark);
    text-transform: uppercase;
    margin-bottom: 0.3rem;
    font-weight: 500;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #444;
}

.price-container {
    margin-top: auto;
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.current-price {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-main);
}

.original-price {
    font-size: 0.9rem;
    color: var(--text-light);
    text-decoration: line-through;
}

.add-to-cart-btn {
    width: 100%;
    margin-top: 1rem;
    padding: 0.8rem;
    border: none;
    border-radius: 25px;
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    color: white;
    font-weight: 500;
    cursor: pointer;
    transition: 0.3s;
}

.add-to-cart-btn:hover {
    opacity: 0.9;
    transform: scale(1.02);
}

@media (max-width: 768px) {
    .main-header {
        display: grid;
        grid-template-columns: 1fr auto;
        /* LogoContainer takes available space, Cart takes auto */
        grid-template-rows: auto auto;
        /* Top row, Search row */
        gap: 1rem;
        padding: 1rem;
    }

    .logo-container {
        grid-column: 1 / 2;
        grid-row: 1;
        width: 100%;
        justify-content: flex-start;
        /* Align menu/logo/brand to left */
    }

    .cart-btn {
        grid-column: 2 / 3;
        grid-row: 1;
        margin-left: 0;
        /* Reset margin */
        position: static;
        /* Ensure not absolute */
    }

    .search-bar {
        grid-column: 1 / -1;
        /* Full width */
        grid-row: 2;
        width: 100%;
    }

    .container {
        flex-direction: column;
        padding-top: 1rem;
    }
}

@media (max-width: 480px) {
    /* Refined Grid adjustments for smaller screens if needed, mostly handled by above now */

    .logo {
        height: 40px;
        /* Small logo */
    }

    .brand-name {
        font-size: 1.1rem;
        /* Slightly smaller text */
        white-space: nowrap;
        /* Prevent wrap */
    }

    /* Ensure Cart button isn't absolute anymore */
    .cart-btn {
        position: static;
        font-size: 1.3rem;
    }

    .main-footer {
        padding: 1.5rem 1rem;
        border-radius: 0;
        margin-top: 2rem;
    }

    .sidebar {
        width: 100%;
        left: -100%;
    }

    .cart-sidebar {
        width: 100%;
        right: -100%;
    }
}

/* Global Overflow Fix */
body {
    overflow-x: hidden;
    width: 100%;
}

/* Cart Button */
.cart-btn {
    position: relative;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    margin-left: 1rem;
    transition: 0.3s;
}

.cart-btn:hover {
    transform: scale(1.1);
}

.cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: var(--primary-dark);
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Cart Sidebar (Right) */
.cart-sidebar {
    position: fixed;
    top: 0;
    right: -320px;
    /* Hidden */
    width: 320px;
    height: 100vh;
    background: var(--white);
    box-shadow: -2px 0 15px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.cart-sidebar.active {
    right: 0;
}

.cart-header {
    padding: 1.5rem;
    background-color: var(--primary);
    color: var(--white);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-header h3 {
    margin: 0;
    font-size: 1.2rem;
}

.close-btn {
    background: none;
    border: none;
    font-size: 2rem;
    color: white;
    cursor: pointer;
    line-height: 1;
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cart-item {
    display: flex;
    gap: 10px;
    border-bottom: 1px solid var(--bg-color);
    padding-bottom: 10px;
    align-items: center;
}

.cart-item img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    background-color: #fafafa;
}

.item-details {
    flex: 1;
}

.item-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
    display: block;
    margin-bottom: 4px;
}

.item-price {
    font-size: 0.9rem;
    color: var(--primary-dark);
    font-weight: 500;
}

.remove-item-btn {
    background: none;
    border: none;
    color: #ff6b6b;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 5px;
    transition: 0.2s;
}

.remove-item-btn:hover {
    transform: scale(1.1);
}

.empty-msg {
    text-align: center;
    color: var(--text-light);
    margin-top: 2rem;
}

.cart-footer {
    padding: 1.5rem;
    border-top: 2px solid var(--bg-color);
    background-color: #FAFAFF;
}

.total-row {
    display: flex;
    justify-content: space-between;
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-main);
}

.cart-actions {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.checkout-btn,
.clear-btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
}

.checkout-btn {
    background: var(--primary-dark);
    color: white;
}

.checkout-btn:hover {
    background: var(--primary);
    box-shadow: 0 4px 10px rgba(255, 158, 202, 0.4);
}

.clear-btn {
    background: white;
    border: 2px solid var(--secondary);
    color: var(--text-light);
}

.clear-btn:hover {
    border-color: #ff6b6b;
    color: #ff6b6b;
}

@media (max-width: 480px) {
    .cart-sidebar {
        width: 100%;
        /* Full screen cart on mobile */
        right: -100%;
    }
}

/* Modal Popup */
.modal {
    display: none;
    /* Hidden by default */
    position: fixed;
    z-index: 2000;
    /* On top of everything */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    justify-content: center;
    align-items: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background-color: var(--white);
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    text-align: center;
    width: 90%;
    max-width: 400px;
    animation: modalSlideIn 0.3s ease-out;
    border: 3px solid var(--secondary);
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-30px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-content h3 {
    color: var(--primary-dark);
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.modal-content p {
    color: var(--text-main);
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.modal-btn {
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 1rem;
    border-radius: 50px;
    cursor: pointer;
    transition: 0.3s;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(255, 193, 227, 0.6);
}

.modal-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(255, 193, 227, 0.8);
}

/* About Page Styles */
.table-container {
    overflow-x: auto;
    margin-top: 1.5rem;
}

.dev-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.dev-table th,
.dev-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid var(--bg-color);
}

.dev-table th {
    background-color: var(--secondary);
    color: var(--primary-dark);
    font-weight: 600;
}

.dev-table tr:hover {
    background-color: #fafafa;
}

.learning-list {
    list-style-type: none;
    margin-top: 1rem;
}

.learning-list li {
    padding: 0.8rem 0;
    border-bottom: 1px dashed var(--bg-color);
    position: relative;
    padding-left: 1.5rem;
}

.learning-list li::before {
    content: '🌸';
    position: absolute;
    left: 0;
    top: 0.8rem;
    font-size: 0.8rem;
}

/* Footer (Themed) */
.main-footer {
    margin-top: 4rem;
    text-align: center;
    padding: 2rem;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    color: white;
    border-radius: 15px 15px 0 0;
    box-shadow: 0 -4px 15px rgba(255, 193, 227, 0.3);
}

.main-footer a {
    color: white;
    text-decoration: none;
    font-weight: 600;
    background-color: rgba(255, 255, 255, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    transition: 0.3s;
}

.main-footer a:hover {
    background-color: white;
    color: var(--primary-dark);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* About Header Overrides */
@media (max-width: 768px) {
    .main-header.about-header {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
        height: auto;
    }

    .about-header .logo-container {
        grid-column: auto;
        grid-row: auto;
        width: 100%;
        justify-content: center;
    }
}