:root {
    --bg: #ffffff;
    --paper: #ffffff;
    --line: #d6e4ff;
    --text: #16325c;
    --muted: #5f7393;
    --accent: #2f7cf6;
    --accent-dark: #1855b8;
    --accent-soft: #eaf2ff;
    --shadow: 0 18px 38px rgba(24, 85, 184, 0.08);
    --radius-lg: 28px;
    --radius-md: 18px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    overflow-x: clip;
    font-family: Georgia, "Times New Roman", serif;
    color: var(--text);
    background: var(--bg);
}

a {
    color: inherit;
    text-decoration: none;
}

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

button, input, textarea, select {
    font: inherit;
}

button {
    border: 0;
    background: transparent;
}

form {
    margin: 0;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
}

.site-header__inner {
    width: min(1460px, calc(100% - 24px));
    margin: 0 auto;
}

.site-header__inner {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr) auto;
    grid-template-areas:
        "brand search actions"
        "brand categories categories";
    gap: 24px;
    align-items: center;
    padding: 18px 0;
}

.page-shell {
    width: min(1200px, calc(100% - 48px));
    margin: 0 auto;
}

.site-brand {
    grid-area: brand;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: stretch;
    min-height: 128px;
}

.site-brand__logo {
    max-height: 128px;
    width: auto;
    object-fit: contain;
}

.site-search {
    grid-area: search;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
}

    .site-search input, .inline-form input, .account-form input, .account-form textarea, .account-form select {
        min-height: 52px;
        padding: 12px 16px;
        border-radius: 18px;
        border: 1px solid var(--line);
        background: var(--paper);
    }

    .site-search button, .primary-button, .secondary-button {
        min-height: 52px;
        padding: 0 20px;
        border-radius: 999px;
        cursor: pointer;
    }

    .site-search button, .primary-button {
        background: linear-gradient(135deg, var(--accent), var(--accent-dark));
        color: #fff;
        font-weight: 700;
    }

.secondary-button {
    border: 1px solid var(--accent);
    background: var(--accent-soft);
    color: var(--accent-dark);
    font-weight: 700;
}

.site-actions, .category-bar, .admin-toolbar, .admin-actions, .product-card__icons, .product-card__price-row, .section-head, .carousel-shell {
    display: flex;
    align-items: center;
    gap: 14px;
}

.site-actions {
    grid-area: actions;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.site-actions > a,
.site-actions > .account-menu {
    flex: 0 0 auto;
}

.text-link, .text-button {
    color: var(--accent-dark);
    font-weight: 700;
    cursor: pointer;
}

.account-menu {
    position: relative;
}

.account-menu__trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 14px;
    border: 1px solid transparent;
    border-radius: 999px;
    color: var(--accent-dark);
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.account-menu__trigger::after {
    content: "▾";
    font-size: 0.85rem;
}

.account-menu.is-open .account-menu__trigger,
.account-menu__trigger:hover {
    background: var(--accent-soft);
    border-color: var(--line);
}

.account-menu__panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 30;
    min-width: 220px;
    display: grid;
    gap: 6px;
    padding: 10px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: #fff;
    box-shadow: 0 18px 36px rgba(24, 85, 184, 0.16);
}

.account-menu__panel[hidden] {
    display: none !important;
}

.account-menu__panel a,
.account-menu__logout {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 42px;
    padding: 0 12px;
    border-radius: 12px;
    color: var(--text);
    font-weight: 600;
    text-align: left;
}

.account-menu__panel a:hover,
.account-menu__logout:hover {
    background: var(--accent-soft);
    color: var(--accent-dark);
}

.account-menu__logout {
    cursor: pointer;
}

.icon-link span {
    display: inline-flex;
    min-width: 24px;
    justify-content: center;
    margin-left: 6px;
    padding: 3px 8px;
    border-radius: 999px;
    background: var(--accent-soft);
}

.category-bar {
    grid-area: categories;
    gap: 10px;
    overflow-x: auto;
    padding: 0 0 12px;
}

    .category-bar a {
        white-space: nowrap;
        padding: 10px 16px;
        border-radius: 999px;
        border: 1px solid var(--line);
        background: #fff;
    }

        .category-bar a.is-active, .category-bar a:hover, .chip {
            background: var(--accent-soft);
            border-color: var(--accent);
            color: var(--accent-dark);
        }

.page-shell {
    padding: 28px 0 56px;
}

.site-footer {
    border-top: 1px solid var(--line);
    background: #fff;
}

.site-footer__inner {
    width: min(1200px, calc(100% - 48px));
    margin: 0 auto;
    padding: 20px 0 28px;
    display: flex;
    justify-content: center;
    gap: 16px;
    color: var(--muted);
}

.status-message {
    margin: 0 0 20px;
    padding: 14px 18px;
    border-radius: 16px;
    background: var(--accent-soft);
    color: var(--accent-dark);
}

.field-validation-error {
    color: #b42318;
    font-size: 0.9rem;
    font-weight: 600;
}

.home-page, .detail-page, .account-page, .profile-page, .admin-page, .policy-page {
    display: grid;
    gap: 28px;
}

.section-block, .account-card, .profile-card, .detail-sidebar, .detail-gallery__item, .admin-table-wrap, .cart-items, .cart-summary {
    padding: 28px;
    border-radius: var(--radius-lg);
    background: var(--paper);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}

.section-head {
    justify-content: space-between;
    margin-bottom: 20px;
}

.section-head--stacked {
    display: grid;
    justify-content: stretch;
}

.section-head h1, .section-head h2, .detail-sidebar h1 {
    margin: 0;
    font-size: clamp(1.7rem, 3vw, 2.8rem);
}

.section-head p, .detail-description, .account-footer, .address-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.hero-slider {
    position: relative;
    min-height: 320px;
    padding: 0;
    overflow: hidden;
    border-radius: 32px;
    background: #fff;
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}

.hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transform: translateX(30px);
    transition: 0.4s ease;
    display: flex; /* Grid yerine Flex daha stabil sonuç verebilir */
    align-items: center;
    justify-content: center;
    background: #fff;
    overflow: hidden; /* Kapsayıcıdan taşmayı engeller */
}

    .hero-slide.is-active {
        opacity: 1;
        transform: translateX(0);
    }


.hero-slide__image {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    object-position: center !important;
    background-color: #fff !important;
}

.hero-kicker, .eyebrow {
    display: inline-flex;
    width: fit-content;
    padding: 8px 14px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent-dark);
    font-size: 0.9rem;
    font-weight: 700;
}

.carousel-shell {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) 52px;
    gap: 18px;
}

.carousel-arrow {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--accent);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    cursor: pointer;
    flex: 0 0 auto;
    color: #fff;
}

.product-carousel {
    display: grid;
    min-width: 0;
    grid-auto-flow: column;
    grid-auto-columns: calc((100% - 48px) / 4);
    gap: 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    padding-bottom: 4px;
}

.carousel-item {
    scroll-snap-align: start;
}

.catalog-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

.product-card {
    display: grid;
    border: 1px solid var(--line);
    border-radius: 26px;
    overflow: hidden;
    background: #fff;
    min-height: 100%;
    cursor: pointer;
}

.product-gallery {
    position: relative;
    aspect-ratio: 1 / 1;
    background: linear-gradient(180deg, #fff, #edf4ff);
}

.product-gallery__image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    padding: 0;
    opacity: 0;
    transition: opacity 0.2s ease;
}

    .product-gallery__image.is-active {
        opacity: 1;
    }

.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(47,124,246,0.96);
    border: 1px solid var(--line);
    cursor: pointer;
    color: #fff;
}

.gallery-nav--prev {
    left: 12px;
}

.gallery-nav--next {
    right: 12px;
}

.product-card__body {
    display: grid;
    gap: 14px;
    padding: 18px;
}

.product-card__name {
    font-size: 1.06rem;
    font-weight: 700;
    min-height: 48px;
}

.product-card__price-row strong, .detail-price {
    font-size: 1.3rem;
}

.icon-button {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--accent);
    background: var(--accent-soft);
    color: var(--accent-dark);
    cursor: pointer;
}

    .icon-button.is-active {
        background: #eaf2ff;
        color: #1855b8;
    }

    .icon-button.is-in-cart {
        background: #eaf2ff;
        color: #1855b8;
    }

.detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(380px, 0.8fr);
    gap: 24px;
    align-items: stretch;
}

.detail-gallery {
    position: relative;
    min-height: 620px;
    overflow: hidden;
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    background: #fff;
    box-shadow: var(--shadow);
}

.detail-gallery__item {
    position: absolute;
    inset: 0;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.2s ease;
    cursor: zoom-in;
}

    .detail-gallery__item.is-active {
        opacity: 1;
        z-index: 1;
    }

    .detail-gallery__item img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

.detail-gallery__nav {
    z-index: 2;
}

.detail-sidebar {
    align-self: stretch;
    display: grid;
    gap: 24px;
    min-height: 620px;
    position: sticky;
    top: 150px;
}

.detail-sidebar__content {
    display: grid;
    gap: 16px;
    align-content: start;
}

.detail-specs, .profile-list {
    display: grid;
    gap: 12px;
    margin: 0;
}

    .detail-specs div, .profile-list div, .address-card {
        padding-bottom: 12px;
        border-bottom: 1px solid var(--line);
    }

    .detail-specs dt, .profile-list dt {
        color: var(--muted);
    }

    .detail-specs dd, .profile-list dd {
        margin: 0;
        font-weight: 700;
    }

.detail-buybox {
    margin-top: auto;
    display: grid;
    gap: 18px;
}

.detail-price {
    font-size: clamp(2rem, 3vw, 2.9rem);
    line-height: 1;
    justify-self: start;
}

.detail-actions {
    justify-content: flex-start;
}

.lightbox {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 32px;
    background: rgba(17, 16, 15, 0.82);
    z-index: 100;
}

    .lightbox[hidden] {
        display: none;
    }

    .lightbox img {
        max-width: min(92vw, 1400px);
        max-height: 88vh;
        object-fit: contain;
    }

.lightbox__close {
    position: absolute;
    top: 24px;
    right: 24px;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid var(--line);
    font-size: 2rem;
    cursor: pointer;
}

.account-page {
    place-items: center;
}

.account-card {
    width: min(920px, 100%);
}

.account-card--wide {
    width: min(1040px, 100%);
}

.account-form {
    display: grid;
    gap: 16px;
}

    .account-form label {
        display: grid;
        gap: 8px;
        font-weight: 600;
    }

.form-grid-two {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.checkbox-row {
    display: flex !important;
    align-items: center;
    gap: 10px;
}

    .checkbox-row input {
        min-height: auto;
    }

.oauth-form {
    margin-top: 12px;
}

.profile-grid, .admin-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.profile-card--wide {
    grid-column: 1 / -1;
}

.orders-row, .admin-row {
    display: grid;
    align-items: center;
    gap: 12px;
    padding: 16px 0;
    border-bottom: 1px solid var(--line);
}

.orders-row {
    grid-template-columns: 1.3fr 1fr 1fr auto;
}

.admin-row {
    grid-template-columns: 1.4fr 1fr 0.8fr 0.7fr 0.8fr 1fr;
}

.admin-row--head {
    padding-top: 0;
    color: var(--muted);
    font-weight: 700;
}

.hero-stat {
    padding: 24px;
    border-radius: 20px;
    background: linear-gradient(180deg, #fff, #f7efe6);
    border: 1px solid var(--line);
}

.inline-form {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.image-upload-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 16px;
}

.image-upload-card {
    display: grid;
    gap: 10px;
    padding: 16px;
    border: 1px dashed var(--line);
    border-radius: 18px;
}

.image-upload-preview {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    background: #fff;
    border-radius: 12px;
}

.hero-slide-admin-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.hero-slide-admin-card {
    display: grid;
    gap: 14px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: #fff;
}

.hero-slide-admin-card__image {
    width: 100%;
    aspect-ratio: 16 / 7;
    object-fit: cover;
    border-radius: 16px;
    border: 1px solid var(--line);
}

.hero-slide-admin-card__body {
    display: grid;
    gap: 6px;
}

    .hero-slide-admin-card__body span {
        color: var(--muted);
        word-break: break-all;
    }

.cart-item, .summary-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
}

.section-title {
    display: grid;
    gap: 8px;
}

    .section-title h1 {
        margin: 0;
    }

    .section-title p, .empty-cart span, .address-select-card span {
        color: var(--muted);
    }

.cart-page {
    display: grid;
    gap: 24px;
}

.cart-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(320px, 0.8fr);
    gap: 24px;
}

.empty-cart {
    display: grid;
    gap: 8px;
}

.cart-item {
    padding: 16px 0;
    border-bottom: 1px solid var(--line);
}

    .cart-item:first-child {
        padding-top: 0;
    }

    .cart-item:last-child {
        padding-bottom: 0;
        border-bottom: 0;
    }

    .cart-item img {
        width: 92px;
        height: 92px;
        object-fit: contain;
        border-radius: 16px;
        background: #fff;
        border: 1px solid var(--line);
        padding: 8px;
    }

.qty-form {
    display: flex;
    gap: 12px;
    align-items: center;
}

.qty-input {
    width: 84px;
    min-height: 44px;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: var(--paper);
}

.checkout-button {
    width: 100%;
    justify-content: center;
}

.address-card__actions {
    display: flex;
    gap: 14px;
    align-items: center;
    margin-top: 12px;
}

.address-select-list {
    display: grid;
    gap: 12px;
    margin: 18px 0;
}

.address-select-card {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fff;
    cursor: pointer;
}

    .address-select-card > span {
        display: grid;
        gap: 4px;
    }

    .address-select-card input {
        margin-top: 4px;
    }

.policy-document {
    max-width: 980px;
    margin: 0 auto;
}

.policy-section {
    display: grid;
    gap: 12px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

    .policy-section:first-of-type {
        padding-top: 0;
        border-top: 0;
    }

    .policy-section h2 {
        margin: 0;
        font-size: 1.3rem;
    }

    .policy-section p {
        margin: 0;
        color: var(--muted);
        line-height: 1.75;
    }

.policy-list {
    margin: 0;
    padding-left: 20px;
    color: var(--muted);
    line-height: 1.75;
}

    .policy-list li + li {
        margin-top: 6px;
    }

@media (max-width: 1100px) {
    .site-header__inner {
        width: min(100% - 24px, 1460px);
        grid-template-columns: 1fr;
        grid-template-areas:
            "brand"
            "search"
            "actions"
            "categories";
    }

    .site-brand {
        min-height: auto;
    }

    .site-brand__logo {
        max-height: 104px;
    }

    .site-actions {
        justify-content: flex-start;
    }

    .product-carousel {
        grid-auto-columns: calc((100% - 16px) / 2);
    }

    .catalog-grid, .image-upload-grid, .admin-stats, .hero-slide-admin-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .detail-layout, .profile-grid, .orders-row, .admin-row, .form-grid-two, .cart-layout {
        grid-template-columns: 1fr;
    }

    .detail-sidebar {
        position: static;
    }
}

@media (max-width: 720px) {
    .page-shell {
        width: min(100% - 24px, 1200px);
    }

    .site-header__inner {
        width: min(100% - 24px, 1460px);
    }

    .site-search {
        grid-template-columns: 1fr;
    }

    .site-actions {
        justify-content: flex-start;
    }

    .account-menu__panel {
        right: auto;
        left: 0;
    }

    .category-bar {
        width: 100%;
    }

    .site-footer__inner {
        width: min(100% - 24px, 1200px);
        flex-direction: column;
        align-items: center;
    }

    .hero-slider, .section-block, .account-card, .profile-card, .detail-sidebar, .admin-table-wrap {
        padding: 20px;
    }

    .detail-gallery {
        min-height: 420px;
    }

    .detail-gallery__item {
        padding: 14px;
    }

    .product-carousel, .catalog-grid, .image-upload-grid, .hero-slide-admin-grid {
        grid-auto-columns: 100%;
        grid-template-columns: 1fr;
    }

    .carousel-arrow {
        display: none;
    }
}
