/* =========================================================
   Lutines Locs — Main stylesheet
   ========================================================= */

:root {
    --primary-color: #606f48;
    --primary-dark: #2e412d;
    --secondary-color: #cead66;
    --secondary-dark: #605420;
    --background-color: #f0efec;
    --text-color: #36260f;
    --text-muted: #777777;
    --card-bg: #ffffff;
    --border-color: #e0deda;
    --danger: #e74c3c;
    --danger-dark: #c0392b;
    --gradient: linear-gradient(
        45deg,
        var(--primary-dark),
        var(--primary-color),
        var(--secondary-color)
    );
    --nav-height: 64px;
    --radius: 10px;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.38);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.1);
    --transition: all 0.2s ease;
}

/*Google fonts*/
.amaranth-regular {
    font-family: "Amaranth", sans-serif;
    font-weight: 400;
    font-style: normal;
}

.amaranth-bold {
    font-family: "Amaranth", sans-serif;
    font-weight: 700;
    font-style: normal;
}

.amaranth-regular-italic {
    font-family: "Amaranth", sans-serif;
    font-weight: 400;
    font-style: italic;
}

.amaranth-bold-italic {
    font-family: "Amaranth", sans-serif;
    font-weight: 700;
    font-style: italic;
}

/* ── Reset & base ──────────────────────────────────────────────────────── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: Amaranth, sans-serif;
    color: var(--text-color);
    background-color: var(--background-color);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

footer {
    margin-top: auto;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    transform: translateY(-3px);
}

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

/* ─── Loading Overlay ─────────────────────────────────────────────── */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    pointer-events: auto;
}

#loading-overlay.hidden {
    display: none;
    pointer-events: none;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 1rem;
}

#loading-text {
    color: #fff;
    font-size: 1.1rem;
    font-weight: 500;
    text-align: center;
}

/* ── Navigation ────────────────────────────────────────────────────────── */
nav {
    background: #fff;
    border-bottom: 1px solid var(--border-color);
    height: var(--nav-height);
    display: flex;
    align-items: center;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.nav-container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    display: flex;
    font-size: 1.4rem;
    font-weight: 800;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
    align-items: center;
    gap: 5px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    color: var(--text-color);
    font-weight: 500;
    font-size: 0.95rem;
}

.nav-links a:hover {
    color: var(--primary-color);
    transform: translateY(-3px);
}

#navbar-logo-img {
    width: 80px;
    position: relative;
    top: 12px;
    box-shadow: var(--shadow-md);
    border-radius: 50%;
    border: 1px solid var(--primary-dark);
}

.cart-icon {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    position: relative;
}

#cart-badge {
    background: var(--primary-color);
    color: #fff;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── Buttons ───────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.6rem 1.4rem;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    border: 2px solid transparent;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
    font-family: "Amaranth";
}

.btn-lg {
    padding: 0.8rem 2rem;
    font-size: 1rem;
}

.btn-sm {
    padding: 0.3rem 0.75rem;
    font-size: 0.82rem;
}

.btn-primary {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: #fff;
    opacity: 1;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(122, 0, 252, 0.3);
}

.btn-secondary {
    background: var(--secondary-color);
    color: #fff;
    border-color: var(--secondary-color);
}

.btn-secondary:hover {
    background: var(--secondary-dark);
    border-color: var(--secondary-dark);
    color: #fff;
    opacity: 1;
}

.btn-outline {
    background: transparent;
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: #fff;
    opacity: 1;
    transform: translateY(-1px);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
    border-color: var(--danger);
}

.btn-danger:hover {
    background: var(--danger-dark);
    border-color: var(--danger-dark);
    color: #fff;
    opacity: 1;
}

.btn-hero {
    background: #fff;
    color: var(--primary-color);
    font-size: 1.05rem;
    padding: 0.85rem 2.2rem;
    border-radius: 50px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border: none;
}

.btn-hero:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    color: var(--primary-dark);
    opacity: 1;
}

.btn-disabled,
.btn[disabled] {
    background: #ccc;
    color: #888;
    cursor: not-allowed;
    border-color: #ccc;
}

.btn-disabled:hover,
.btn[disabled]:hover {
    transform: none;
    box-shadow: none;
    opacity: 1;
}

/* ── Layout ────────────────────────────────────────────────────────────── */
.container {
    max-width: 1600px;
    padding: 2rem 1.5rem;
    justify-items: center;
    margin: 0 auto;
}

.section {
    padding: 1rem 0;
}

.section-alt {
    background: #fff;
}

.section-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 2rem;
    text-align: center;
}

.section-cta {
    text-align: center;
    margin-top: 2.5rem;
}

/* ── Flash messages ─────────────────────────────────────────────────────── */
.flash-messages {
    max-width: 1200px;
    margin: 1rem auto 0;
    padding: 0 1.5rem;
}

.flash {
    padding: 0.85rem 1.2rem;
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.95rem;
}

.flash-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.flash-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.flash-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* ── Page header ────────────────────────────────────────────────────────── */
.page-header {
    background: var(--gradient);
    color: #fff;
    padding: 3rem 1.5rem;
    text-align: center;
}

.page-header h1 {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
}

.page-header p {
    opacity: 0.85;
    font-size: 1rem;
}

/* ── Hero ───────────────────────────────────────────────────────────────── */
.hero {
    background: var(--gradient);
    color: #fff;
    padding: 5rem 2rem;
    text-align: center;
    min-height: 450px;
}

.hero-content {
    display: flex;
    flex-direction: column;
    margin: 0 auto;
    gap: 1.5rem;
    align-items: center;
    justify-content: center;
}

.hero h1 {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 1rem;
    letter-spacing: -0.5px;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 2.2rem;
    opacity: 0.9;
}

/* ── Home page Book ────────────────────────────────────────────────────── */
#lutineslocs-book {
    display: flex;
    justify-content: center;
    position: relative;
    height: 35vh;
    cursor: pointer;
}

@keyframes book-open {
    0% {
        transform: scaleX(0);
    }
    100% {
        transform: scaleX(1);
    }
}

#lutineslocs-book img.open {
    animation: book-open 0.4s ease forwards;
}

#lutineslocs-book.open {
    height: auto;
}

#book-page-1,
#book-page-2 {
    display: block;
    position: relative;
    width: 40%;
    height: 90%;
}

#book-page-1.hidden,
#book-page-2.hidden {
    display: none;
}

#book-pages {
    user-select: none;
    z-index: 1;
    position: absolute;
    top: 4%;
    height: 100%;
    display: flex;
    flex-direction: row;
    justify-content: center;
    color: var(--text-color);
    gap: 5px;
    font-size: 1.17vh;
    text-align: start;
}
#book-pages.open {
    animation: book-open 0.4s ease forwards;
}

@keyframes pulse {
    0% {
        transform: scale(0.8);
        opacity: 0.8;
    }
    100% {
        transform: scale(2.5);
        opacity: 0;
    }
}

#touch-pulse {
    position: absolute;
    width: 20px;
    height: 20px;
    background: #fff;
    top: 50%;
    border-radius: 50%;
    animation: pulse 1s ease-out infinite;
    pointer-events: none;
}

#touch-pulse.hidden {
    display: none;
}

/* ── Features grid ──────────────────────────────────────────────────────── */
.features-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    text-align: center;
    justify-content: center;
}

.feature {
    width: 15rem;
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.feature h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.feature p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* ── Setup / empty state notices ────────────────────────────────────────── */
.setup-notice,
.empty-state,
.cart-empty {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    max-width: 520px;
    margin: 2rem auto;
}

.setup-notice-icon,
.empty-state-icon,
.cart-empty-icon {
    font-size: 3.5rem;
    margin-bottom: 1rem;
}

.setup-notice h2,
.empty-state h2,
.cart-empty h2 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

.setup-notice p,
.empty-state p,
.cart-empty p {
    color: var(--text-muted);
}

.setup-notice code,
.empty-state code {
    background: var(--background-color);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.9rem;
}

/* ── Product grid ───────────────────────────────────────────────────────── */
.product-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    justify-content: center;
    width: stretch;
}

/* ── Product card ───────────────────────────────────────────────────────── */
.product-card {
    background: var(--card-bg);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    width: stretch;
    max-width: 25rem;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.product-card-link {
    display: block;
    overflow: hidden;
}

.product-card-img {
    width: 100%;
    height: 230px;
    object-fit: cover;
    transition: transform 0.35s ease;
}

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

.product-card-img-placeholder {
    width: 100%;
    height: 230px;
    background: linear-gradient(135deg, #ede9fe, #d1fae5);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
}

.product-card-body {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-card-title-link {
    color: var(--text-color);
    opacity: 1;
}

.product-card-title-link:hover {
    color: var(--primary-color);
    opacity: 1;
}

.product-card-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.product-card-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.product-card-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: auto;
}

/* ── Product detail ─────────────────────────────────────────────────────── */
.product-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3.5rem;
    align-items: start;
    padding-bottom: 3rem;
}

.product-images {
    position: sticky;
    top: calc(var(--nav-height) + 1rem);
}

.product-detail-img {
    width: 100%;
    border-radius: 14px;
    object-fit: cover;
    max-height: 50vh;
}

.product-detail-img-placeholder {
    width: 100%;
    aspect-ratio: 1;
    background: linear-gradient(135deg, #ede9fe, #d1fae5);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 5rem;
}

.product-thumbnails {
    display: flex;
    gap: 0.6rem;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}

.product-thumbnail {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    opacity: 0.7;
}

.product-thumbnail:hover,
.product-thumbnail.active {
    border-color: var(--primary-color);
    opacity: 1;
}

.product-detail-title {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0.6rem;
}

.product-detail-price {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.product-detail-description {
    color: var(--text-muted);
    margin-bottom: 2rem;
    line-height: 1.85;
    font-size: 0.97rem;
}

.product-detail-description p {
    margin-bottom: 0.75rem;
}

/* ── Variant selector ───────────────────────────────────────────────────── */
.variant-selector {
    margin-bottom: 1.5rem;
}

.variant-selector label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.variant-selector select {
    width: 100%;
    padding: 0.65rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 1rem;
    background: #fff;
    cursor: pointer;
    transition: var(--transition);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

.variant-selector select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(122, 0, 252, 0.12);
}

/* ── Quantity stepper ───────────────────────────────────────────────────── */
.quantity-selector {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    margin-bottom: 1.75rem;
}

.quantity-selector label {
    font-weight: 600;
    font-size: 0.95rem;
    white-space: nowrap;
}

.quantity-input {
    display: flex;
    align-items: center;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
}

.quantity-input button {
    padding: 0.5rem 1.1rem;
    background: var(--background-color);
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-color);
    transition: var(--transition);
    line-height: 1;
}

.quantity-input button:hover {
    background: var(--border-color);
}

.quantity-input input {
    width: 56px;
    text-align: center;
    border: none;
    border-left: 2px solid var(--border-color);
    border-right: 2px solid var(--border-color);
    padding: 0.5rem 0.25rem;
    font-size: 1rem;
    font-weight: 600;
    background: #fff;
}

.quantity-input input:focus {
    outline: none;
}

/* hide browser number spinners */
.quantity-input input[type="number"]::-webkit-inner-spin-button,
.quantity-input input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.quantity-input input[type="number"] {
    -moz-appearance: textfield;
}

/* ── Stock badge ────────────────────────────────────────────────────────── */
.stock-badge {
    min-height: 1.4rem;
    margin-bottom: 1rem;
    font-size: 0.88rem;
    font-weight: 600;
}

.stock-badge.stock-low {
    color: #c0392b;
}

/* ── Breadcrumb ─────────────────────────────────────────────────────────── */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
    font-size: 0.88rem;
    color: var(--text-muted);
    padding-top: 1rem;
}

.breadcrumb span {
    color: var(--text-muted);
}

.breadcrumb a {
    color: var(--primary-color);
    font-weight: 500;
}

/* ── Cart layout ────────────────────────────────────────────────────────── */
.cart-container {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 2rem;
    align-items: start;
}

/* ── Cart items panel ───────────────────────────────────────────────────── */
.cart-items {
    background: var(--card-bg);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.cart-item {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.25rem;
    border-bottom: 1px solid var(--border-color);
}

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

.cart-item-img {
    width: 84px;
    height: 84px;
    object-fit: cover;
    border-radius: 10px;
    flex-shrink: 0;
}

.cart-item-img-placeholder {
    width: 84px;
    height: 84px;
    background: linear-gradient(135deg, #ede9fe, #d1fae5);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    flex-shrink: 0;
}

.cart-item-details {
    flex: 1;
    min-width: 0;
}

.cart-item-title {
    font-weight: 600;
    color: var(--text-color);
    display: block;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cart-item-title:hover {
    color: var(--primary-color);
    opacity: 1;
}

.cart-item-variant {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}

.cart-item-price {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1rem;
}

.cart-item-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.qty-btn {
    background: var(--background-color);
    border: 1.5px solid var(--border-color);
    border-radius: 6px;
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-weight: 700;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    line-height: 1;
}

.qty-btn:hover {
    background: var(--border-color);
}

.qty-display {
    font-weight: 700;
    min-width: 28px;
    text-align: center;
    font-size: 0.95rem;
}

/* ── Cart summary sidebar ───────────────────────────────────────────────── */
.cart-summary {
    background: var(--card-bg);
    border-radius: 14px;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: calc(var(--nav-height) + 1rem);
}

.cart-summary h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.cart-summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.8rem;
    font-size: 0.95rem;
    color: var(--text-muted);
}

.cart-summary-row span:last-child {
    font-weight: 600;
    color: var(--text-color);
}

.cart-summary-total {
    font-weight: 700;
    font-size: 1.05rem;
    border-top: 2px solid var(--border-color);
    padding-top: 1rem;
    margin-top: 0.5rem;
    color: var(--text-color) !important;
}

.cart-summary-total span {
    color: var(--text-color) !important;
}

.cart-summary-note {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 0.75rem;
    text-align: center;
}

/* ── Footer ─────────────────────────────────────────────────────────────── */
footer {
    background: var(--primary-dark);
    color: rgba(255, 255, 255, 0.65);
    padding: 2rem;
    text-align: center;
    font-size: 0.9rem;
}

footer a {
    color: var(--secondary-color);
}

footer a:hover {
    color: #fff;
    opacity: 1;
}

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .cart-container {
        grid-template-columns: 1fr;
    }

    .cart-summary {
        position: static;
    }
}

@media (max-width: 768px) {
    .product-detail {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .product-images {
        position: static;
    }

    .hero h1 {
        font-size: 2.2rem;
    }

    .hero p {
        font-size: 1.05rem;
    }
}

@media (max-width: 600px) {
    nav {
        padding: 0 1rem;
    }

    .nav-links {
        gap: 1.25rem;
    }

    .nav-logo {
        font-size: 1.11rem;
    }

    .container {
        padding: 1.5rem 1rem;
    }

    .page-header {
        padding: 2rem 1rem;
    }

    .page-header h1 {
        font-size: 1.8rem;
    }

    .hero {
        padding: 4rem 1rem;
    }

    .cart-item {
        flex-wrap: wrap;
    }

    .cart-item-actions {
        width: 100%;
        justify-content: flex-end;
    }
}
