/* Stone Market Styles */
:root {
    --font-base: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --color-background: #f8f7f4;
    --color-card: #ffffff;
    --color-accent: #6f4e37;
    --color-accent-dark: #4c2f20;
    --color-accent-light: #d6c1a5;
    --color-muted: #8b8b87;
    --color-text: #1f1f1d;
    --color-border: #e0ded8;
    --color-success: #2f855a;
    --color-danger: #c53030;
    --shadow-soft: 0 16px 32px rgba(34, 32, 27, 0.08);
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 8px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--font-base);
    background: var(--color-background);
    color: var(--color-text);
}

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

a:hover {
    text-decoration: underline;
}

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

.container {
    width: min(1120px, 90vw);
    margin: 0 auto;
}

.flex {
    display: flex;
}

.between {
    justify-content: space-between;
}

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

.grid {
    display: grid;
    gap: 2rem;
}

.page-wrapper {
    min-height: calc(100vh - 240px);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-sm);
    background: linear-gradient(120deg, var(--color-accent) 0%, var(--color-accent-dark) 100%);
    color: #fff;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 12px 24px rgba(111, 78, 55, 0.2);
}

.btn:hover {
    transform: translateY(-2px);
    text-decoration: none;
}

.btn.outline {
    background: transparent;
    color: var(--color-accent);
    border: 1px solid var(--color-accent);
    box-shadow: none;
}

.btn.small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn.danger {
    background: var(--color-danger);
    box-shadow: 0 12px 24px rgba(197, 48, 48, 0.18);
}

.btn.full-width {
    width: 100%;
}

.link {
    color: var(--color-accent);
    font-weight: 600;
}

.link-button {
    background: none;
    border: none;
    color: var(--color-accent);
    cursor: pointer;
    font-weight: 600;
}

.inline-form {
    display: inline;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(12px);
    background: rgba(248, 247, 244, 0.9);
    border-bottom: 1px solid rgba(224, 222, 216, 0.6);
    padding: 1rem 0;
}

.brand {
    font-weight: 700;
    font-size: 1.25rem;
}

.main-nav {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.main-nav a {
    font-weight: 500;
}

.hero {
    padding: clamp(3.25rem, 7vw, 4.5rem) 0 4rem;
}

.hero-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 3rem;
    align-items: center;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.3em;
    font-size: 0.75rem;
    color: var(--color-accent);
    font-weight: 600;
}

.hero h1 {
    font-size: clamp(2.4rem, 3vw, 3.2rem);
    margin: 1rem 0;
    line-height: 1.1;
}

.hero-visual {
    position: relative;
    min-height: 320px;
}

.hero-stone {
    position: absolute;
    width: 240px;
    height: 240px;
    border-radius: var(--radius-lg);
    background-size: cover;
    background-position: center;
    box-shadow: var(--shadow-soft);
}

.hero-stone-a {
    top: 0;
    right: 10%;
    background-image: url('../images/hero-stone-a.jpg');
}

.hero-stone-b {
    bottom: 0;
    left: 0;
    background-image: url('../images/hero-stone-b.jpg');
}

.filters {
    padding: 2rem 0 1rem;
}

.filters-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
    gap: 1.5rem;
    background: var(--color-card);
    padding: 2rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
}

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

.field label {
    font-weight: 600;
    color: var(--color-muted);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="search"],
select,
textarea {
    padding: 0.75rem 1rem;
    width: 100%;
    max-width: 100%;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
    background: #fff;
    font: inherit;
    transition: border 0.2s ease, box-shadow 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(111, 78, 55, 0.15);
}

.range-inputs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    width: 100%;
    gap: 0.75rem;
}

.range-inputs input[type="number"] {
    flex: 1 1 0;
    min-width: 0;
}

.characteristics-grid,
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
    gap: 1.5rem;
}

.characteristic-field,
.characteristic-filter {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stones-grid {
    padding: 4rem 0;
}

.section-head {
    text-align: center;
    margin-bottom: 2rem;
}

.section-head h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

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

.stone-card {
    display: block;
    color: inherit;
    background: var(--color-card);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    transition: transform 0.2s ease;
}

.stone-card:hover {
    transform: translateY(-6px);
}

.stone-card-media {
    position: relative;
    height: 180px;
    overflow: hidden;
}

.stone-card-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.stone-texture {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(111, 78, 55, 0.75), rgba(214, 193, 165, 0.6)),
    url('https://images.unsplash.com/photo-1503387762-592deb58ef4e?auto=format&fit=crop&w=800&q=60') center/cover;
}

.badge {
    display: inline-block;
    background: rgba(111, 78, 55, 0.9);
    color: #fff;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge.neutral {
    background: rgba(0, 0, 0, 0.1);
    color: var(--color-text);
}

.badge.success {
    background: var(--color-success);
}

.badge.danger {
    background: var(--color-danger);
}

.stone-card-content {
    padding: 1.5rem;
}

.stone-card-price {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0.25rem 0;
}

.stone-card-owner {
    color: var(--color-muted);
    font-size: 0.9rem;
}

.how-it-works {
    padding: 4rem 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.9), rgba(214, 193, 165, 0.15));
}

.steps-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.step {
    background: var(--color-card);
    padding: 2rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
}

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--color-accent);
    color: #fff;
    font-weight: 600;
    margin-bottom: 1rem;
}

.site-footer {
    background: #191817;
    color: #f0ece4;
    padding: 4rem 0 2rem;
}

.footer-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2.5rem;
}

.site-footer a {
    color: inherit;
    display: block;
    margin-bottom: 0.75rem;
}

.site-footer h4,
.site-footer h5 {
    margin-bottom: 1rem;
}

.footer-copy {
    text-align: center;
    margin-top: 2rem;
    font-size: 0.85rem;
    color: rgba(240, 236, 228, 0.7);
}

.alert {
    width: min(720px, 90vw);
    margin: 1.5rem auto;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-sm);
    font-weight: 500;
}

.alert.success {
    background: rgba(47, 133, 90, 0.1);
    color: var(--color-success);
    border: 1px solid rgba(47, 133, 90, 0.2);
}

.alert.error {
    background: rgba(197, 48, 48, 0.1);
    color: var(--color-danger);
    border: 1px solid rgba(197, 48, 48, 0.2);
}

.error-text {
    color: var(--color-danger);
    font-size: 0.8rem;
}

.empty-state {
    text-align: center;
    color: var(--color-muted);
    padding: 2rem 0;
}

.auth-body {
    display: flex;
    min-height: 100vh;
    background: linear-gradient(135deg, rgba(111, 78, 55, 0.08), rgba(214, 193, 165, 0.25));
}

.auth-wrapper {
    margin: auto;
}

.auth-card {
    background: var(--color-card);
    padding: 2.5rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
    width: min(420px, 90vw);
}

.auth-card .logo {
    font-weight: 700;
    font-size: 1.5rem;
}

.auth-subtitle {
    color: var(--color-muted);
    margin-bottom: 2rem;
}

.auth-form .field {
    margin-bottom: 1.25rem;
}

.auth-meta {
    text-align: center;
    margin-top: 1rem;
    color: var(--color-muted);
}

.dashboard {
    padding: clamp(2.5rem, 6vw, 4rem) 0;
}

.dashboard-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    margin-bottom: 3rem;
}

.admin-shortcuts {
    margin-bottom: 3rem;
}

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

.shortcut-card {
    display: block;
    background: var(--color-card);
    border-radius: var(--radius-md);
    padding: 1.75rem;
    box-shadow: var(--shadow-soft);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.shortcut-card h3 {
    margin: 0 0 0.5rem;
    font-size: 1.1rem;
}

.shortcut-card p {
    margin: 0;
    color: var(--color-muted);
    line-height: 1.4;
}

.shortcut-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 32px rgba(34, 32, 27, 0.12);
    text-decoration: none;
}

.stat-card {
    background: var(--color-card);
    padding: 1.75rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    display: block;
}

.stat-label {
    color: var(--color-muted);
    font-weight: 500;
}

.dashboard-section {
    background: var(--color-card);
    border-radius: var(--radius-md);
    padding: 2rem;
    box-shadow: var(--shadow-soft);
    margin-bottom: 2rem;
}

.section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

.table-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.card {
    background: var(--color-card);
    padding: 2rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
}

.form-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.form-grid .full {
    grid-column: 1 / -1;
}

.model-placeholder {
    padding: 4rem;
    text-align: center;
    background: rgba(214, 193, 165, 0.2);
    border-radius: var(--radius-md);
}

.stone-detail {
    padding: 4rem 0;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 3rem;
}

.stone-viewer {
    width: 100%;
    height: 420px;
    border-radius: var(--radius-md);
    background: #000;
    display: block;
}

.model-viewer-wrapper {
    position: relative;
}

.model-viewer-wrapper .model-loader {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    background: rgba(0, 0, 0, 0.35);
    color: #fff;
    font-size: 0.875rem;
    font-weight: 600;
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.3s ease;
    border-radius: var(--radius-md);
}

.model-viewer-wrapper.loaded .model-loader {
    opacity: 0;
    visibility: hidden;
}

.model-loader .spinner {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    animation: spin 0.8s linear infinite;
}

.seller-card {
    margin-top: 2rem;
    padding: 1.5rem;
    background: rgba(214, 193, 165, 0.15);
    border-radius: var(--radius-md);
}

.buy-section {
    padding: 3rem 0;
}

.buy-card {
    background: var(--color-card);
    padding: 2.5rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
}

.form-grid .actions {
    justify-content: flex-end;
}

.related-stones {
    padding: 3rem 0 5rem;
}

.error-page {
    padding: 8rem 0;
}

.error-page .container {
    text-align: center;
}

.error-page h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.admin-management {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.summary-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 0.75rem;
}

.summary-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 0.5rem;
}

.timeline {
    list-style: none;
    margin: 0;
    padding: 0;
    border-left: 2px solid var(--color-border);
}

.timeline li {
    padding: 0.5rem 0 0.5rem 1rem;
    position: relative;
}

.timeline li::before {
    content: '';
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--color-accent);
    position: absolute;
    left: -6px;
    top: 14px;
}

.cart-grid,
.checkout-grid,
.payment-grid,
.order-grid,
.shipping-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.incoterm-grid {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.incoterm-grid .checkbox {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.spec-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.spec-grid .label {
    display: block;
    font-size: 0.85rem;
    color: var(--color-muted);
}

.mini-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.document-list {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem 0;
}

.document-list li {
    margin-bottom: 0.5rem;
}

.logistics-dashboard .inline-form {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .main-nav {
        gap: 1rem;
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .filters-form {
        grid-template-columns: 1fr;
        padding: 1.5rem;
        gap: 1.25rem;
    }

    .range-inputs {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }

    .range-inputs span {
        display: none;
    }

    .range-inputs input[type="number"] {
        flex: 1 0 auto;
    }

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

    .actions {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .actions .btn {
        width: 100%;
    }

    .dashboard-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .hero-visual {
        min-height: 280px;
    }

    .hero-stone {
        width: 180px;
        height: 180px;
    }

    .stone-viewer {
        height: 320px;
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 480px) {
    .filters-form {
        padding: 1.25rem;
    }
}
