/* =================================
   RESET & BASE STYLES
   ================================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    background-color: #fff;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

/* =================================
   CONTAINER
   ================================= */

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

/* =================================
   HEADER & NAVIGATION
   ================================= */

.header {
    background-color: #fff;
    border-bottom: 1px solid #eee;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.header__content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: #1a1a1a;
    transition: color 0.3s ease;
}

.logo:hover {
    color: #ff6b6b;
}

.nav__list {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav__link {
    font-weight: 500;
    color: #6b6b6b;
    position: relative;
    padding-bottom: 0.25rem;
    transition: color 0.3s ease;
}

.nav__link:hover {
    color: #1a1a1a;
}

.nav__link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #ff6b6b;
    transition: width 0.3s ease;
}

.nav__link:hover::after {
    width: 100%;
}

.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
}

.menu-toggle span {
    width: 25px;
    height: 3px;
    background-color: #333;
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* =================================
   HERO SECTION
   ================================= */

.hero {
    background: linear-gradient(135deg, #f5f5f5 0%, #fff 100%);
    padding: 60px 0;
    text-align: center;
}

.hero__title {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: #1a1a1a;
}

.hero__subtitle {
    font-size: 1.125rem;
    color: #666;
    max-width: 600px;
    margin: 0 auto;
}

/* =================================
   SECTIONS
   ================================= */

.section {
    padding: 60px 0;
}

.section:nth-child(even) {
    background-color: #f9f9f9;
}

.section__title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 3rem;
    text-align: center;
    color: #1a1a1a;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* =================================
   PRODUCTS GRID
   ================================= */

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

.product-card {
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    cursor: pointer;
}

.product-card:hover,
.product-card:focus-visible {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
}

.product-card__image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background-color: #fff;
}

.product-card__image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.product-card:hover .product-card__image img {
    transform: scale(1.05);
}

.product-card__content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.product-card__title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    line-height: 1.3;
    color: #1a1a1a;
}

.product-card__specs {
    font-size: 0.875rem;
    color: #666;
    line-height: 1.6;
    margin-bottom: 1rem;
    flex-grow: 1;
}

.product-card__footer {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

.product-card__price {
    font-size: 1.125rem;
    font-weight: 700;
    color: #ff6b6b;
    white-space: nowrap;
}

/* =================================
   BUTTONS
   ================================= */

.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-block;
}

.btn--primary {
    background-color: #ff6b6b;
    color: #fff;
}

.btn--primary:hover {
    background-color: #ff5252;
    transform: scale(1.02);
}

.btn--primary:active {
    transform: scale(0.98);
}

.btn--small {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    width: 100%;
}

/* =================================
   DELIVERY SECTION
   ================================= */

.delivery__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.delivery__item {
    text-align: center;
    padding: 1.5rem;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.delivery__icon {
    display: block;
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.delivery__item h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: #333;
}

.delivery__item p {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.6;
}

.delivery__info {
    background-color: #f0f0f0;
    padding: 2rem;
    text-align: center;
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
}

.delivery__hours,
.delivery__coverage {
    margin: 0.5rem 0;
    font-size: 1rem;
}

/* =================================
   CONTACTS SECTION
   ================================= */

.section.contacts-section {
    background: linear-gradient(135deg, #fff 0%, #f5f5f5 100%);
    padding-bottom: 80px;
}

.contacts__card {
    max-width: 440px;
    margin: 0 auto;
    background-color: #fff;
    border-radius: 16px;
    padding: 3rem 2.5rem;
    text-align: center;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    border-top: 4px solid #ff6b6b;
}

.contacts__heading {
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #999;
    margin-bottom: 1rem;
}

.contacts__phone {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 2rem;
    letter-spacing: 0.5px;
    transition: color 0.3s ease;
}

.contacts__phone:hover {
    color: #ff6b6b;
}

.contacts__telegram {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.75rem;
    background-color: #eaf6fd;
    color: #1c8dc9;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.contacts__telegram:hover {
    background-color: #29A9EB;
    color: #fff;
    transform: scale(1.03);
}

.contacts__telegram-icon {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
}

/* =================================
   FOOTER
   ================================= */

.footer {
    background-color: #333;
    color: #fff;
    padding: 2rem 0;
}

.footer__content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer__text {
    font-size: 0.9rem;
    opacity: 0.8;
}

.footer__links {
    list-style: none;
    display: flex;
    gap: 2rem;
}

.footer__links a {
    color: #fff;
    transition: color 0.3s ease;
}

.footer__links a:hover {
    color: #ff6b6b;
}

/* =================================
   RESPONSIVE DESIGN
   ================================= */

@media (max-width: 768px) {
    .header__content {
        padding: 0.75rem 0;
    }

    .menu-toggle {
        display: flex;
    }

    .nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: #fff;
        border-bottom: 1px solid #eee;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }

    .nav.active {
        max-height: 300px;
    }

    .nav__list {
        flex-direction: column;
        gap: 0;
    }

    .nav__link {
        padding: 1rem 20px;
        display: block;
    }

    .nav__link::after {
        display: none;
    }

    .hero__title {
        font-size: 1.75rem;
    }

    .hero__subtitle {
        font-size: 1rem;
    }

    .section {
        padding: 40px 0;
    }

    .section__title {
        font-size: 1.5rem;
        margin-bottom: 2rem;
    }

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

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

    .contacts__content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .footer__content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .footer__links {
        flex-direction: column;
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    .hero {
        padding: 40px 0;
    }

    .hero__title {
        font-size: 1.5rem;
        margin-bottom: 0.75rem;
    }

    .hero__subtitle {
        font-size: 0.95rem;
    }

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

    .product-card__image {
        height: 150px;
    }

    .nav__list {
        padding: 0.5rem 0;
    }

    .nav__link {
        padding: 0.75rem 15px;
        font-size: 0.95rem;
    }

    .logo {
        font-size: 1.25rem;
    }
}

/* =================================
   PRODUCT MODAL
   ================================= */

.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
}

.modal.active {
    display: block;
}

.modal__overlay {
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.6);
}

.modal__dialog {
    position: relative;
    background-color: #fff;
    border-radius: 12px;
    max-width: 960px;
    width: min(92%, 960px);
    max-height: 88vh;
    margin: 6vh auto;
    overflow-y: auto;
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 0;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal__close {
    position: sticky;
    top: 1rem;
    left: calc(100% - 3rem);
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    font-size: 1.5rem;
    line-height: 1;
    color: #333;
    z-index: 2;
    grid-column: 2;
    grid-row: 1;
    margin: 1rem 1rem -3.25rem 0;
    transition: background-color 0.3s ease;
}

.modal__close:hover {
    background-color: #fff;
    color: #ff6b6b;
}

.modal__gallery {
    grid-column: 1;
    grid-row: 1 / span 2;
    min-width: 0;
    background-color: #fafafa;
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
}

.modal__main-image {
    position: relative;
    flex-grow: 1;
    min-width: 0;
    min-height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
}

.modal__main-image img {
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: 400px;
    object-fit: contain;
}

.modal__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    font-size: 1.5rem;
    color: #333;
    transition: all 0.3s ease;
}

.modal__nav:hover {
    background-color: #ff6b6b;
    color: #fff;
}

.modal__nav--prev {
    left: 0.75rem;
}

.modal__nav--next {
    right: 0.75rem;
}

.modal__thumbs {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
}

.modal__thumbs img {
    width: 56px;
    height: 56px;
    object-fit: contain;
    background-color: #fff;
    border: 2px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    flex-shrink: 0;
    transition: border-color 0.3s ease;
}

.modal__thumbs img.active {
    border-color: #ff6b6b;
}

.modal__info {
    grid-column: 2;
    grid-row: 2;
    min-width: 0;
    padding: 1.5rem 2rem 2rem;
}

.modal__title {
    font-size: 1.5rem;
    color: #333;
    margin-bottom: 1rem;
}

.modal__specs {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.modal__description {
    color: #444;
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.modal__footer {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.modal__price {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ff6b6b;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .modal__dialog {
        grid-template-columns: 1fr;
        margin: 3vh auto;
        max-height: 94vh;
    }

    .modal__close {
        left: calc(100% - 2.75rem);
        margin: 0.75rem 0.75rem -3rem 0;
    }

    .modal__gallery {
        grid-column: 1;
        grid-row: 1;
        padding: 1rem;
    }

    .modal__info {
        grid-column: 1;
        grid-row: 2;
        padding: 1rem 1.25rem 1.5rem;
    }
}

/* =================================
   CART
   ================================= */

.header__actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cart-toggle {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    color: #333;
    transition: color 0.3s ease;
}

.cart-toggle:hover {
    color: #ff6b6b;
}

.cart-toggle__icon {
    width: 24px;
    height: 24px;
}

.cart-toggle__count {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 999px;
    background-color: #ff6b6b;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
}

.cart-drawer {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1100;
}

.cart-drawer.active {
    display: block;
}

.cart-drawer__overlay {
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.6);
}

.cart-drawer__panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(420px, 100%);
    background-color: #fff;
    display: flex;
    flex-direction: column;
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.2);
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.cart-drawer.active .cart-drawer__panel {
    transform: translateX(0);
}

.cart-drawer__header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #eee;
}

.cart-drawer__header h2 {
    flex-grow: 1;
    font-size: 1.25rem;
    color: #1a1a1a;
}

.cart-drawer__back {
    width: 2rem;
    height: 2rem;
    font-size: 1.25rem;
    line-height: 1;
    color: #666;
    transition: color 0.3s ease;
}

.cart-drawer__back:hover {
    color: #ff6b6b;
}

.cart-view,
.checkout-view,
.checkout-success {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    min-height: 0;
}

.cart-drawer__close {
    width: 2rem;
    height: 2rem;
    font-size: 1.5rem;
    line-height: 1;
    color: #666;
    transition: color 0.3s ease;
}

.cart-drawer__close:hover {
    color: #ff6b6b;
}

.cart-drawer__items {
    flex-grow: 1;
    overflow-y: auto;
    padding: 0 1.5rem;
}

.cart-drawer__empty {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    padding: 2rem;
    text-align: center;
}

.cart-drawer__empty[hidden] {
    display: none;
}

.cart-item {
    display: grid;
    grid-template-columns: 64px 1fr auto;
    gap: 0.75rem;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.cart-item__image {
    width: 64px;
    height: 64px;
    background-color: #f9f9f9;
    border-radius: 6px;
    overflow: hidden;
}

.cart-item__image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.cart-item__title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 0.25rem;
}

.cart-item__price {
    font-size: 0.85rem;
    color: #ff6b6b;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.cart-item__qty {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cart-item__qty-btn {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 4px;
    background-color: #f5f5f5;
    color: #333;
    font-size: 1rem;
    line-height: 1;
    transition: background-color 0.3s ease;
}

.cart-item__qty-btn:hover {
    background-color: #eee;
}

.cart-item__remove {
    align-self: start;
    width: 1.75rem;
    height: 1.75rem;
    font-size: 1.25rem;
    color: #999;
    transition: color 0.3s ease;
}

.cart-item__remove:hover {
    color: #ff6b6b;
}

.cart-drawer__footer {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid #eee;
}

.cart-drawer__subtotal {
    display: flex;
    justify-content: space-between;
    font-size: 1.1rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 1rem;
}

.cart-drawer__checkout {
    width: 100%;
    text-align: center;
}

.toast {
    position: fixed;
    left: 50%;
    bottom: 1.5rem;
    transform: translate(-50%, 20px);
    background-color: #1a1a1a;
    color: #fff;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 0.9rem;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    z-index: 1200;
    max-width: 90vw;
    text-align: center;
}

.toast.active {
    opacity: 1;
    transform: translate(-50%, 0);
}

.cart-view[hidden],
.checkout-view[hidden],
.checkout-success[hidden] {
    display: none;
}

/* Checkout form */

.checkout-view {
    overflow-y: auto;
    padding: 1.5rem;
    gap: 1.25rem;
}

.checkout-summary {
    background-color: #f9f9f9;
    border-radius: 8px;
    padding: 1rem;
    font-size: 0.85rem;
    color: #666;
}

.checkout-summary__row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.25rem 0;
}

.checkout-summary__total {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid #eee;
    font-weight: 700;
    color: #1a1a1a;
}

.checkout-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.checkout-field label,
.checkout-field__label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #333;
}

.checkout-field input[type="text"],
.checkout-field input[type="tel"] {
    padding: 0.75rem 1rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

.checkout-field input[type="text"]:focus,
.checkout-field input[type="tel"]:focus {
    outline: none;
    border-color: #ff6b6b;
}

.payment-methods {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.payment-method input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.payment-method__card {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 3rem;
    border: 2px solid #eee;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.payment-method input:checked + .payment-method__card {
    border-color: #ff6b6b;
    box-shadow: 0 0 0 1px #ff6b6b;
}

.payment-method input:focus-visible + .payment-method__card {
    outline: 2px solid #ff6b6b;
    outline-offset: 2px;
}

.payment-method__logo {
    font-weight: 800;
    font-size: 0.85rem;
    letter-spacing: 0.3px;
    padding: 0.3rem 0.75rem;
    border-radius: 4px;
    color: #fff;
}

.payment-method__logo--payme {
    background-color: #00cdba;
}

.payment-method__logo--click {
    background-color: #0079c1;
}

.payment-method__logo--uzum {
    background-color: #7000ff;
}

.checkout-view__submit {
    width: 100%;
    text-align: center;
    margin-top: auto;
}

.checkout-success {
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
    gap: 0.75rem;
}

.checkout-success__icon {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    background-color: #e5f8ec;
    color: #2fb463;
    font-size: 1.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.5rem;
}

.checkout-success h3 {
    font-size: 1.25rem;
    color: #1a1a1a;
}

.checkout-success p {
    color: #666;
    font-size: 0.9rem;
    max-width: 280px;
}

.checkout-success .btn {
    margin-top: 1rem;
    width: 100%;
    text-align: center;
}

@media (max-width: 480px) {
    .cart-drawer__panel {
        width: 100%;
    }

    .payment-methods {
        grid-template-columns: 1fr;
    }
}

/* =================================
   UTILITY CLASSES
   ================================= */

.text-center {
    text-align: center;
}

.text-muted {
    color: #999;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }
