:root {
    --primary-color: #160C28;
    --secondary-color: #EFCB68;
    --background-color: #E1EFE6;
    --text-color: #000411;
    --white: #ffffff;
}

body {
    font-family: 'Roboto', sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    height: 100%;
}

.text-primary {
    color: var(--text-color);
}

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

/* Navigation styles */
nav {
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: var(--primary-color);
    color: var(--white);
    padding: 15px 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

nav .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: var(--white);
    text-decoration: none;
    display: flex;
    align-items: center;
    margin-right: 10px;
}

.logo-icon {
    width: 32px;
    height: 32px;
    margin-right: 10px;
}

.nav-right {
    display: flex;
    align-items: center;
}

.search-container {
    display: flex;
    margin-right: 20px;
}

#search-input {
    padding: 8px;
    border: none;
    border-radius: 4px 0 0 4px;
    width: 200px;
}

#search-button {
    padding: 8px 12px;
    border: none;
    background-color: var(--secondary-color);
    color: var(--primary-color);
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#search-button:hover {
    background-color: #e67e22;
}

.nav-menu {
    display: flex;
    list-style-type: none;
    margin: 0;
    padding: 0;
}

.nav-menu li {
    margin-left: 20px;
}

.nav-menu a {
    color: var(--white);
    text-decoration: none;
    transition: color 0.3s ease;
}

.nav-menu a:hover {
    color: var(--secondary-color);
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--white);
    font-size: 24px;
    cursor: pointer;
}

#cart-button {
    position: relative;
    background: none;
    border: none;
    color: var(--white);
    font-size: 24px;
    cursor: pointer;
}

#cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: var(--secondary-color);
    color: var(--primary-color);
    font-size: 12px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
}

/* Header styles */
header {
    background-color: var(--secondary-color);
    color: var(--primary-color);
    text-align: center;
    padding: 40px 0;
}

header h1 {
    margin: 0;
    font-size: 36px;
}

header p {
    margin-top: 10px;
    font-size: 18px;
}

/* Slideshow styles */
#promo {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 90px;
}

.slideshow {
    position: relative;
    height: 80px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.slide {
    position: absolute;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    font-size: 1.5em;
    white-space: nowrap;
}

.slide.active {
    opacity: 1;
}

/* Main content styles */
main {
    padding: 40px 0;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 30px;
}

.product {
    background-color: var(--white);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

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

.product img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    cursor: pointer;
}

.product h3 {
    margin: 15px 0 10px;
}

.product p {
    color: var(--primary-color);
    font-weight: bold;
    margin-bottom: 15px;
    font-size: 20px;
    min-height: 60px;
}

.btn {
    color: var(--text-color);
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.btn-primary {
    margin-top: auto;
    background-color: var(--primary-color);
    color: var(--white);
}

.btn-primary:hover {
    background-color: #2c1950;
}

.size-selector-container {
    margin-top: 15px;
}

#size-selector {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

#size-selector option.out-of-stock {
    color: #999;
    background-color: #f0f0f0;
}

/* Pagination styles */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 40px;
}

.pagination button {
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    padding: 10px 15px;
    margin: 0 5px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.pagination button:hover {
    background-color: var(--secondary-color);
}

.pagination button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

#page-info {
    margin: 0 10px;
    font-size: 16px;
}

.pagination-numbers {
    display: inline-flex;
    align-items: center;
    margin: 0 10px;
}

.page-number {
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    padding: 10px;
    margin: 0 5px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.page-number.active {
    transition: transform 0.3s ease;
    background-color: var(--secondary-color);
    transform: translateY(-5px);
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.8);
}

.modal-content {
    position: relative;
    margin: auto;
    padding: 20px;
    width: 90%;
    max-width: 800px;
    top: 60%;
    transform: translateY(-50%);
    background-color: var(--white);
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.close {
    color: #aaa;
    position: absolute;
    top: 10px;
    right: 25px;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: #000;
    text-decoration: none;
    cursor: pointer;
}

#preview-image {
    width: 100%;
    max-height: 400px;
    object-fit: contain;
    border-radius: 4px;
    margin-bottom: 20px;
}

#preview-details {
    text-align: left;
}

#preview-title {
    font-size: 24px;
    margin-bottom: 10px;
}

#preview-description {
    font-size: 16px;
    color: #666;
    margin-bottom: 10px;
}

#preview-price {
    font-size: 20px;
    font-weight: bold;
    color: var(--primary-color);
}

/* Discount ribbon */
.discount-ribbon {
    position: absolute;
    top: 18px;
    right: 30px;
    background-color: var(--secondary-color);
    color: var(--text-color);
    padding: 5px 10px;
    transform: rotate(45deg) translate(29%, -50%);
    font-size: 14px;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* About and Contact section styles */
.section {
    padding: 40px 0;
    margin-top: 40px;
}

.section h2 {
    color: var(--primary-color);
    font-size: 28px;
    margin-bottom: 20px;
}

.section p {
    margin-bottom: 15px;
    line-height: 1.6;
}

.section ul {
    margin-bottom: 20px;
    padding-left: 20px;
}

.section ul li {
    margin-bottom: 10px;
}

/* Contact form styles */
#contact-form {
    max-width: 500px;
    margin-bottom: 30px;
}

.contact-info {
    margin-top: 30px;
}

.contact-info h3 {
    color: var(--primary-color);
    font-size: 20px;
    margin-bottom: 10px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.form-group textarea {
    height: 150px;
}

/* Footer styles */
footer {
    background-color: var(--primary-color);
    color: var(--white);
    text-align: center;
    padding: 20px 0;
    margin-top: 60px;
}

/* Loader styles */
.loader-container {
    display: flex;
    height: 100vh;
    justify-content: center;
    align-items: center;
}

.loader {
    width: 50px;
    aspect-ratio: 1;
    border-radius: 50%;
    border: 8px solid #0000;
    border-right-color: var(--secondary-color);
    position: relative;
    animation: l24 1s infinite linear;
}

.loader:before,
.loader:after {
    content: "";
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    border: inherit;
    animation: inherit;
    animation-duration: 2s;
}

.loader:after {
    animation-duration: 4s;
}

@keyframes l24 {
    100% {
        transform: rotate(1turn)
    }
}

/* Dialog styling */
dialog {
    border: none;
    border-radius: 8px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

dialog::backdrop {
    background: rgba(0, 0, 0, 0.6);
}

#cart-dialog h2 {
    margin-top: 0;
}

.btn-secondary {
    background-color: #aaa;
    color: var(--white);
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
}

#checkout {
    height: 100vh;
    background-color: var(--white);
    border-radius: 8px;
    padding: 30px;
    margin-top: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

#cart-total,
#checkout-total {
    font-weight: bold;
    margin: 20px 0;
    font-size: 18px;
}

#checkout-form {
    display: grid;
    gap: 20px;
}

/* Utility classes */
.hidden {
    display: none !important;
}

/* Responsive styles */
@media (max-width: 768px) {
    nav .container {
        flex-direction: row;
        align-items: flex-start;
    }

    .nav-right {
        width: 100%;
        justify-content: space-between;
        margin-top: 15px;
    }

    .menu-toggle {
        display: block;
    }

    .nav-menu {
        display: none;
        width: 100%;
        flex-direction: column;
        margin-top: 15px;
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-menu li {
        margin-left: 0;
        margin-bottom: 10px;
    }

    header h1 {
        font-size: 28px;
    }

    header p {
        font-size: 16px;
    }

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

    .product h3 {
        font-size: 18px;
    }

    .product p {
        font-size: 16px;
    }

    .btn {
        padding: 8px 16px;
    }

    .pagination {
        flex-direction: column;
        align-items: center;
    }

    .pagination-numbers {
        margin: 10px 0;
    }

    .page-number {
        margin: 0 3px;
    }

    #promo {
        height: auto;
        padding: 20px 0;
    }

    .slideshow {
        height: auto;
    }

    .slide {
        font-size: 1.2em;
        white-space: normal;
        text-align: center;
    }

    .modal-content {
        width: 95%;
        top: 50%;
    }

    .close {
        top: 5px;
        right: 10px;
    }

    .section {
        padding: 20px 0;
    }

    .section h2 {
        font-size: 24px;
    }

    #contact-form {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .nav-right {
        flex-wrap: wrap;
    }

    .search-container {
        width: 100%;
        margin-right: 0;
        margin-bottom: 10px;
    }

    #cart-button {
        margin-left: auto;
    }

    .product-grid {
        grid-template-columns: 1fr;
    }

    .pagination button {
        padding: 8px 12px;
    }

    nav .container {
        flex-direction: column;
        align-items: center;
    }

    .logo {
        margin-bottom: 10px;
    }

    .nav-right {
        flex-direction: column;
        align-items: center;
    }

    .search-container {
        margin-bottom: 10px;
    }

    #search-input {
        width: 100%;
    }

    .nav-menu {
        margin-top: 10px;
        text-align: center;
    }

    .nav-menu li {
        margin: 0 0 10px 0;
    }
}
