/* Custom Styles for Sophie Shop */

:root {
    --primary-color:       #1B3A20;
    --secondary-color:     #4A7C59;
    --accent-color:        #E8892A;
    --success-color:       #4A7C59;
    --danger-color:        #C0392B;
    --header-footer-color: #1B5E20;
    --surface-color:       #F4F8F4;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--surface-color);
}

/* Announcement bar */
.announcement-bar {
    background-color: var(--accent-color);
    color: #fff;
    text-align: center;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/* Delivery badge on product detail */
.delivery-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--secondary-color);
    background: rgba(74,124,89,0.08);
    border: 1px solid rgba(74,124,89,0.2);
    border-radius: 999px;
    padding: 0.4rem 1rem;
}

/* Navigation */
.navbar {
    background-color: var(--header-footer-color) !important;
    border-radius: 0 0 24px 24px;
}

.navbar-brand {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.35rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.navbar-nav .nav-link {
    border-radius: 999px;
    padding-left: 0.85rem !important;
    padding-right: 0.85rem !important;
    transition: background 0.2s;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link:focus {
    background: rgba(255,255,255,0.12);
}

/* Category Bar */
.category-bar {
    background-color: #fff;
    border-bottom: 2px solid #e9ecef;
    padding: 0 0.75rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

.category-bar-list {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0;
}

.category-bar-list > li {
    position: relative;
}

.category-bar-divider {
    width: 1px;
    background-color: #dee2e6;
    margin: 0.5rem 0.5rem;
    align-self: stretch;
}

.category-bar-list > li > a {
    display: block;
    padding: 0.75rem 1.1rem;
    color: #555;
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
    border-bottom: 3px solid transparent;
    transition: color 0.2s, border-color 0.2s;
}

.category-bar-list > li > a:hover,
.category-bar-list > li > a.active {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
}

/* Subcategory dropdown on hover */
.category-bar-submenu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 0 0 6px 6px;
    list-style: none;
    margin: 0;
    padding: 0.25rem 0;
    min-width: 160px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 1000;
}

.category-bar-list > li:hover .category-bar-submenu {
    display: block;
}

.category-bar-submenu li a {
    display: block;
    padding: 0.4rem 1rem;
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.875rem;
}

.category-bar-submenu li a:hover,
.category-bar-submenu li a.active {
    background-color: #f8f9fa;
    color: var(--accent-color);
}

/* Mobile category dropdown */
.category-mobile-toggle {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: none;
    border: none;
    color: #555;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.65rem 0.25rem;
    cursor: pointer;
    width: 100%;
    transition: color 0.2s;
}

.category-mobile-toggle:hover,
.category-mobile-toggle[aria-expanded="true"] {
    color: var(--accent-color);
}

.category-mobile-chevron {
    margin-left: auto;
    transition: transform 0.2s ease;
}

.category-mobile-toggle[aria-expanded="true"] .category-mobile-chevron {
    transform: rotate(180deg);
}

.category-mobile-list {
    list-style: none;
    margin: 0;
    padding: 0.25rem 0;
    border-top: 1px solid #e9ecef;
}

.category-mobile-list > li > a {
    display: block;
    padding: 0.55rem 0.5rem;
    color: #555;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border-bottom: 1px solid #f0f0f0;
    transition: color 0.15s;
}

.category-mobile-list > li > a:hover,
.category-mobile-list > li > a.active {
    color: var(--accent-color);
    background-color: #fafafa;
}

.category-mobile-sublist {
    list-style: none;
    padding: 0 0 0 1rem;
    margin: 0;
}

.category-mobile-sublist li a {
    display: block;
    padding: 0.35rem 0.5rem;
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.82rem;
    border-bottom: 1px solid #f5f5f5;
    transition: color 0.15s;
}

.category-mobile-sublist li a:hover,
.category-mobile-sublist li a.active {
    color: var(--accent-color);
}

/* Product Grid */
.product-grid {
    /* Keep spacing only; let Bootstrap's .row control layout */
    margin: 1.5rem 0 2rem 0;
}

.product-item {
    padding: 0.25rem;
}

.image-wrapper {
    overflow: hidden;
    aspect-ratio: 3 / 4;
    border-radius: 20px 20px 0 0;
}

.product-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 20px 20px 0 0;
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.carousel-prev { left: 10px; }
.carousel-next { right: 10px; }

.thumb-item.active-thumb {
    outline: 3px solid var(--secondary-color);
}

/* Active gallery thumbnail */
.gallery-thumb.active-thumb {
    box-shadow: 0 0 0 3px rgba(74,124,89,0.2);
    border-color: var(--secondary-color);
}

/* Smooth main image transition */
#main-image {
    transition: opacity 180ms ease-in-out;
    opacity: 1;
}

/* Ensure product info card sits above image if overlap happens */
.card.shadow-sm {
    position: relative;
    z-index: 10;
}

.product-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(184,107,42,0.10);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-card:hover {
    transform: translateY(-6px) rotate(1deg);
    box-shadow: 0 12px 28px rgba(184,107,42,0.18);
}

.product-info {
    padding: 0.6rem 0.75rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-info h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
}

.product-info p {
    margin: 0.25rem 0;
    color: #666;
    font-size: 0.95rem;
}

.product-price {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--accent-color);
    margin: 0.5rem 0;
}

.product-description {
    color: #888;
    font-size: 0.9rem;
    margin: 0.5rem 0;
    flex: 1;
}

/* Buttons */
.btn-primary {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    font-weight: 500;
    border-radius: 999px;
}

.btn-primary:hover {
    background-color: #cf7420;
    border-color: #cf7420;
}

.btn-outline-primary {
    color: var(--accent-color);
    border-color: var(--accent-color);
    border-radius: 999px;
}

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

/* Product title link color */
.card-title a {
    color: var(--accent-color);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 0.2rem rgba(74, 124, 89, 0.25);
}

.form-label {
    font-weight: 500;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 4rem 0;
    text-align: center;
    border-radius: 8px;
    margin-bottom: 3rem;
    min-height: 560px; /* slightly taller hero so background image displays fully */
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-section h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.hero-section p {
    font-size: 1.2rem;
    margin-bottom: 0;
    opacity: 0.95;
}

/* Tables */
.table {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.table thead {
    background-color: var(--primary-color);
    color: white;
}

.table tbody tr {
    border-bottom: 1px solid #eee;
}

.table tbody tr:hover {
    background-color: #f9f9f9;
}

/* Cart Summary */
.cart-summary {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-top: 2rem;
}

.cart-summary h3 {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 1.5rem;
}

/* Pagination */
.pagination {
    margin-top: 2rem;
}

.page-link {
    color: var(--secondary-color);
    border-color: #ddd;
}

.page-link:hover {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
    color: white;
}

.page-item.active .page-link {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
}

/* Footer */
footer {
    margin-top: auto;
    background-color: var(--header-footer-color) !important;
    border-radius: 32px 32px 0 0;
    overflow: hidden;
    position: relative;
}

.footer-rings {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.footer-ring {
    position: absolute;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 1px solid rgba(255,255,255,0.08);
}

.footer-ring--1 { width: 160px; height: 160px; }
.footer-ring--2 { width: 280px; height: 280px; border-color: rgba(255,255,255,0.05); }
.footer-ring--3 { width: 420px; height: 420px; border-color: rgba(255,255,255,0.03); }

/* Alerts */
.alert {
    border: none;
    border-radius: 6px;
}

.alert-success {
    background-color: #dff0e4;
    border-color: #b8d9c3;
    color: #1B3A20;
}

.alert-danger {
    background-color: #fae3e0;
    border-color: #f0c4bf;
    color: #7B1F17;
}

.alert-info {
    background-color: #e6f0ea;
    border-color: #c0d9cb;
    color: #1B3A20;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-section h1 {
        font-size: 1.8rem;
    }
    
    .product-grid {
        /* smaller spacing on mobile when using Bootstrap columns */
        margin: 1rem 0;
    }
    
    .product-item img,
    .product-image {
        height: 100%;
    }

    .product-item {
        padding: 0.1rem;
    }

    .product-info {
        padding: 0.3rem 0.5rem;
    }

    .product-info .card-title {
        font-size: .8rem !important;
        margin-bottom: 0 !important;
    }

    .product-price {
        font-size: .85rem;
        margin-bottom: 0 !important;
    }

    .product-description {
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .hero-section {
        min-height: 380px;
        padding: 2.5rem 0;
    }

    .image-carousel-wrapper .image-wrapper {
        height: 360px;
    }

    .card.shadow-sm {
        min-height: auto;
    }
}

/* Loading animation */
.spinner-border {
    color: var(--secondary-color);
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--secondary-color);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #3A6347;
}

/* Product detail carousel — enforce 3:4 ratio at all sizes */
#productCarousel .carousel-inner {
    aspect-ratio: 3 / 4;
}

#productCarousel .carousel-inner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@media (max-width: 768px) {
    #productCarousel .carousel-inner {
        aspect-ratio: 3 / 4;
    }
}

/* ─── Product detail: media tabs (Fotos / Video) ────────────────────────── */
.media-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.media-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 1rem;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border: 1.5px solid #dee2e6;
    border-radius: 999px;
    background: transparent;
    color: #888;
    cursor: pointer;
    transition: all 0.18s;
}

.media-tab-btn.active {
    border-color: var(--secondary-color);
    color: var(--secondary-color);
    background: rgba(74,124,89,0.06);
}

.media-tab-btn:hover:not(.active) {
    border-color: #adb5bd;
    color: #555;
}

.media-pane { display: none; }
.media-pane.active { display: block; }

.video-container {
    aspect-ratio: 16 / 9;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
}

.video-container iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* ─── Product detail: carousel controls ─────────────────────────────────── */
.carousel-control-prev,
.carousel-control-next {
    position: static;
    width: auto;
    color: #333;
    opacity: 1;
}

.carousel-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-top: 12px;
}

.carousel-controls .btn-arrow {
    background: none;
    border: 1px solid #dee2e6;
    border-radius: 50%;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #333;
    transition: background .15s;
}

.carousel-controls .btn-arrow:hover { background: #f0f0f0; }
.carousel-counter { font-size: .85rem; color: #6c757d; min-width: 40px; text-align: center; }

/* ─── Dashboard: image upload form ──────────────────────────────────────── */
.image-preview-grid { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; }
.image-preview-item { position: relative; }
.image-preview-item img { width: 100px; height: 100px; object-fit: cover; border-radius: 6px; border: 1px solid #dee2e6; }
.image-preview-item .delete-btn {
    position: absolute; top: -6px; right: -6px;
    background: var(--danger-color); color: #fff; border: none; border-radius: 50%;
    width: 22px; height: 22px; font-size: 12px; line-height: 22px; text-align: center;
    cursor: pointer; padding: 0;
}

#image-drop-zone {
    border: 2px dashed #adb5bd; border-radius: 8px; padding: 32px;
    text-align: center; cursor: pointer; transition: border-color .2s, background .2s;
}
#image-drop-zone.dragover { border-color: var(--secondary-color); background: #edf3ef; }
#new-image-previews { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; }
.new-preview { width: 100px; height: 100px; object-fit: cover; border-radius: 6px; border: 1px solid #dee2e6; }

.dashboard-thumb {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 4px;
}

.dashboard-thumb-placeholder {
    width: 48px;
    height: 48px;
    background: #eee;
    border-radius: 4px;
}

/* ─── Payment: method selection cards ───────────────────────────────────── */
.payment-method-card {
    border: 2px solid #dee2e6;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.payment-method-card:hover {
    border-color: var(--accent-color);
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.payment-method-card .method-logo {
    height: 48px;
    object-fit: contain;
    margin-bottom: 1rem;
}

#paypal-button-container { min-height: 50px; }

/* ─── Landing hero ───────────────────────────────────────────────────────── */
.landing-hero {
    position: relative;
    width: 100%;
    height: 88vh;
    overflow: hidden;
    border-radius: 0 0 12px 12px;
}

.landing-hero__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
}

/* Gradient caption area — taller so text has more room */
.landing-hero__caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 4rem 1.5rem 5rem;
    background: linear-gradient(transparent, rgba(0,0,0,0.72) 60%);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    z-index: 2;
    animation: heroFadeUp 0.9s ease both;
}

@keyframes heroFadeUp {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
}

.landing-hero__eyebrow {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.75);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 999px;
    padding: 0.3rem 1rem;
    animation: heroFadeUp 0.9s 0.1s ease both;
}

.landing-hero__title {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: clamp(2.8rem, 7vw, 5.5rem);
    font-weight: 600;
    color: #fff;
    margin: 0;
    line-height: 1.05;
    letter-spacing: -0.01em;
    animation: heroFadeUp 0.9s 0.2s ease both;
}

.landing-hero__sub {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.65);
    letter-spacing: 0.06em;
    margin: 0;
    animation: heroFadeUp 0.9s 0.3s ease both;
}

.landing-hero__cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    padding: 0.65rem 1.75rem;
    background: var(--accent-color);
    color: #fff;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-decoration: none;
    border-radius: 999px;
    transition: background 0.2s, transform 0.2s;
    animation: heroFadeUp 0.9s 0.4s ease both;
}

.landing-hero__cta:hover {
    background: #cf7420;
    color: #fff;
    transform: translateY(-2px);
}

/* ── Decorative rings on hero (top-right corner) ── */
.landing-rings {
    position: absolute;
    top: -120px;
    right: -120px;
    pointer-events: none;
}

.landing-ring {
    position: absolute;
    border-radius: 50%;
    border: 1.5px solid rgba(255,255,255,0.28);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.landing-ring--1 { width: 320px; height: 320px; }
.landing-ring--2 { width: 500px; height: 500px; border-color: rgba(255,255,255,0.16); }
.landing-ring--3 { width: 700px; height: 700px; border-color: rgba(255,255,255,0.08); }

/* Small accent ring bottom-left */
.landing-ring-accent {
    position: absolute;
    bottom: 80px;
    left: 32px;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    border: 1.5px solid rgba(255,255,255,0.2);
    pointer-events: none;
}

/* ── Wave at the top of hero (page bg drapes over) ── */
.landing-wave-top {
    position: absolute;
    top: -1px;
    left: 0;
    right: 0;
    line-height: 0;
    pointer-events: none;
    z-index: 1;
}

.landing-wave-top svg {
    display: block;
    width: 100%;
    height: 80px;
}

/* ── Wave divider (hero → page) ── */
.landing-wave {
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    line-height: 0;
    pointer-events: none;
}

.landing-wave svg {
    display: block;
    width: 100%;
    height: 90px;
}

/* ─── Featured collection section ───────────────────────────────────────── */
.landing-featured {
    padding: 3rem 0 2rem;
}

.landing-featured__header {
    position: relative;
    text-align: center;
    margin-bottom: 2.5rem;
    padding: 2rem 0;
}

/* Concentric rings behind section title */
.featured-rings {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.featured-ring {
    position: absolute;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.featured-ring--1 {
    width: 220px;
    height: 220px;
    border: 1px solid rgba(74,124,89,0.18);
}

.featured-ring--2 {
    width: 340px;
    height: 340px;
    border: 1px solid rgba(74,124,89,0.08);
}

.landing-featured__eyebrow {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--secondary-color);
    margin: 0 0 0.5rem;
    position: relative;
}

.landing-featured__title {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 600;
    color: var(--primary-color);
    margin: 0 0 0.5rem;
    position: relative;
}

.landing-featured__subtitle {
    font-size: 0.9rem;
    color: #888;
    margin: 0;
    position: relative;
}

@media (max-width: 768px) {
    .landing-hero { height: 60vh; }
    .landing-hero__caption { padding: 2rem 1rem 4rem; }
    .landing-hero__title { font-size: 2.4rem; }
    .landing-rings { top: -80px; right: -80px; }
    .landing-ring--1 { width: 200px; height: 200px; }
    .landing-ring--2 { width: 320px; height: 320px; }
    .landing-ring--3 { width: 460px; height: 460px; }
    .landing-ring-accent { display: none; }
    .featured-ring--1 { width: 160px; height: 160px; }
    .featured-ring--2 { width: 260px; height: 260px; }
}

/* ─── intl-tel-input: Bootstrap integration ─────────────────────────────── */
.iti {
    width: 100%;
}

.iti input.form-control {
    border-radius: 8px !important;
}

.iti__selected-flag {
    border-radius: 8px 0 0 8px;
}

.iti--separate-dial-code .iti__selected-flag {
    background-color: #f8f9fa;
    border-right: 1px solid #dee2e6;
}

.iti--separate-dial-code .iti__selected-flag:hover {
    background-color: #e9ecef;
}

/* ─── Footer: Instagram link ─────────────────────────────────────────────── */
.instagram-link {
    background: rgba(255,255,255,.15);
    color: #fff;
    font-size: .95rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    margin-top: 0.25rem;
    transition: background .2s;
}

.instagram-link:hover {
    background: rgba(255,255,255,.28);
    color: #fff;
}