/* Studio M Brand Page Styling */
:root {
    --primary-color: #B8D9E0;
    --primary-dark: #A2C8D2;
    --primary-light: #fdf5f6;
    --secondary-color: #5a6268;    /* Muted Slate */
    --text-color: #2c2c2c;
    --bg-color: #E0BFB8;        /* Rose Gold */
    --card-bg: rgba(255, 255, 255, 0.94);
    --box-shadow-light: 0 10px 25px rgba(0,0,0,0.08);
    --box-shadow-medium: 0 15px 35px rgba(0,0,0,0.15);
}

body {
    font-family: 'Colombia', 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-color);
    margin: 0;
    color: var(--text-color);
    min-height: 100vh;
    padding-bottom: 70px; /* Space for mobile cart bar */
}

/* --- Layout Containers --- */
.site-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
    box-sizing: border-box;
    position: relative;
    z-index: 2;
}

/* --- Utility Classes --- */
.mobile-hide { display: none; }
.desktop-hide { display: block; }

/* --- Site Header & Logo (Centered Logo Layout) --- */
.site-header {
    padding: 1rem 0 1.5rem 0;
    width: 100%;
}

.header-inner {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    min-height: 60px;
}

.back-link {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-color);
    text-decoration: none;
    font-weight: bold;
    font-size: 0.95rem;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(5px);
    border-radius: 20px;
    transition: all 0.2s ease;
    z-index: 10;
    white-space: nowrap;
}

.back-link:hover {
    background: #fff;
    transform: translateY(-50%) translateX(-3px);
}

.logo {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 6px 12px;
}

.logo img {
    max-width: 240px;
    max-height: 75px;
    object-fit: contain;
    display: block;
}

/* --- Search Navigation --- */
.search-nav {
    display: flex;
    justify-content: center;
    padding: 0.5rem 0 1.5rem 0;
}

.search-bar {
    display: flex;
    width: 100%;
    max-width: 450px;
    border-radius: 30px;
    overflow: hidden;
    background: var(--card-bg);
    box-shadow: var(--box-shadow-light);
    border: 1px solid rgba(255, 255, 255, 0.6);
}

.search-bar input {
    flex: 1;
    border: none;
    outline: none;
    padding: 0.85rem 1.25rem;
    font-size: 1rem;
    background: transparent;
    color: var(--text-color);
}

.search-bar button {
    background: var(--primary-color);
    border: none;
    padding: 0.85rem 1.25rem;
    color: #fff;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.3s ease;
}

.search-bar button:hover {
    background: var(--primary-dark);
}

/* --- Product Grid & Cards --- */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1.5rem;
    padding: 0.5rem 0;
}

.product-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 18px;
    box-shadow: var(--box-shadow-light);
    border: 1px solid rgba(255, 255, 255, 0.6);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    padding: 1.2rem;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--box-shadow-medium);
}

.product-image-container {
    width: 100%;
    padding-bottom: 100%;
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    background: #fff;
}

.product-image-container img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* --- Color Swatches Row --- */
.color-swatches-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 8px 0 12px 0;
}

.color-swatches {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}

.swatch {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    padding: 0;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    outline: none;
}

.swatch:hover {
    transform: scale(1.25);
}

.swatch.active {
    transform: scale(1.2);
    box-shadow: 0 0 0 2px var(--primary-dark), 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* --- Gift Voucher Form & Custom Amount Styles --- */
.voucher-form-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
    width: 100%;
    box-sizing: border-box;
}

.voucher-form-container input[type="text"] {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 12px;
    font-size: 0.85rem;
    box-sizing: border-box;
    outline: none;
}

.voucher-form-container input[type="text"]:focus,
.custom-amount-wrapper input:focus {
    border-color: #b76e79;
}

.preset-amounts {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    width: 100%;
}

.amount-btn {
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    color: #374151;
    padding: 6px 8px;
    border-radius: 12px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1 1 auto;
    text-align: center;
    min-width: 45px;
}

.amount-btn:hover {
    background: #e5e7eb;
}

.amount-btn.active {
    background: var(--primary-color);
    color: #ffffff;
    border-color: var(--primary-dark);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
}

/* FIXED Custom Amount Input Overflow Container */
.custom-amount-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    box-sizing: border-box;
    margin-top: 2px;
}

.custom-amount-wrapper span {
    font-size: 0.9rem;
    font-weight: bold;
    color: #555;
    flex-shrink: 0;
}

.custom-amount-wrapper input {
    width: 100%;
    min-width: 0; /* Prevents flex input from expanding outside card */
    flex: 1;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 12px;
    font-size: 0.85rem;
    box-sizing: border-box;
    outline: none;
}

/* --- Badges & Ribbons --- */
.product-volume {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 600;
    color: #b76e79;
    background-color: #fcedf0;
    padding: 2px 8px;
    border-radius: 12px;
    margin: 4px auto 8px auto;
    width: fit-content;
}

.stock-banner {
    position: absolute;
    top: 18px;
    right: -38px;
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 5px 38px;
    transform: rotate(45deg);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    z-index: 5;
    pointer-events: none;
}

.backorder-banner {
    background: #B8C5E0;
}

.delivery-notice {
    font-size: 0.75rem;
    color: #b45309;
    background: #fef3c7;
    border: 1px solid #fde68a;
    padding: 4px 8px;
    border-radius: 6px;
    margin: 4px 0 8px 0;
    text-align: center;
    font-weight: 500;
}

/* --- Product Info & Buttons --- */
.product-info {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.product-name {
    font-size: 1.05rem;
    margin: 0 0 0.5rem 0;
    color: var(--text-color);
    font-weight: 600;
}

.product-price {
    font-weight: bold;
    color: var(--text-color);
    margin: 0 0 0.8rem 0;
    font-size: 1.2rem;
}

.add-to-cart-btn {
    display: block;
    width: 100%;
    padding: 0.75rem 0;
    background: var(--primary-color);
    color: #fff;
    text-decoration: none;
    font-weight: bold;
    border-radius: 25px;
    transition: background 0.3s ease, transform 0.2s ease;
    margin-top: auto;
    box-sizing: border-box;
    letter-spacing: 0.5px;
}

.add-to-cart-btn:hover {
    background: var(--primary-dark);
}

.add-to-cart-btn.btn-backorder {
    background-color: #B8C5E0;
}

.add-to-cart-btn.btn-backorder:hover {
    background-color: #E0D3B8;
}

/* --- Empty Products State --- */
.no-products-card {
    background: var(--card-bg);
    padding: 40px 20px;
    text-align: center;
    border-radius: 20px;
    box-shadow: var(--box-shadow-light);
    margin: 20px 0;
}

.no-products {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 20px;
}

.btn-back {
    display: inline-block;
    padding: 10px 25px;
    background: var(--primary-color);
    color: #fff;
    text-decoration: none;
    border-radius: 20px;
    font-weight: bold;
}

/* --- Cart Info (Slide-in Sidebar - Shifted off Scrollbar) --- */
.cart-info {
    position: fixed;
    top: 25px;
    right: 18px; /* Clearance for native scrollbar */
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 999;
    pointer-events: none;
}

.cart-info a {
    background: var(--primary-color);
    color: #fff;
    text-decoration: none;
    font-weight: bold;
    padding: 12px 20px;
    border-radius: 10px;
    transform: translateX(150%);
    animation: slide-in-right 0.8s ease forwards;
    box-shadow: -2px 4px 10px rgba(0, 0, 0, 0.2);
    pointer-events: auto;
    transition: background 0.3s ease, transform 0.2s ease;
}

.cart-info a:nth-child(2) {
    animation-delay: 0.6s;
}

.cart-info a:hover {
    background: var(--primary-dark);
    transform: translateX(0) scale(1.05);
}

@keyframes slide-in-right {
    to {
        transform: translateX(0);
    }
}

.cart-bar .cart-link {
    flex: 1;
    text-align: center;
    padding: 0.6rem 0;
    text-decoration: none;
    color: var(--text-color);
    font-weight: bold;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

.cart-bar .cart-link.highlight {
    color: var(--primary-dark);
}

/* --- Background Layers & 3D Extruded Logos --- */
.brand-background,
.brand-logo-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.brand-background {
    background-color: var(--bg-color);
    z-index: 0;
}

.brand-logo-bg {
    z-index: 1;
}

.brand-logo-bg img {
    position: absolute;
    pointer-events: none;
    opacity: 0.18;
    filter: 
        drop-shadow(0px 1px 0px rgba(255, 255, 255, 0.4))
        drop-shadow(1px 1px 0px rgba(0, 0, 0, 0.25))
        drop-shadow(2px 2px 0px rgba(0, 0, 0, 0.20))
        drop-shadow(3px 3px 0px rgba(0, 0, 0, 0.15))
        drop-shadow(4px 4px 0px rgba(0, 0, 0, 0.10))
        drop-shadow(6px 12px 18px rgba(0, 0, 0, 0.25));
    mix-blend-mode: multiply;
    transition: transform 0.1s linear;
}

/* --- DESKTOP VIEW ADJUSTMENTS --- */
@media (min-width: 769px) {
    body {
        padding-bottom: 0;
    }

    .mobile-hide { display: inline-block; }
    .desktop-hide { display: none; }

    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
        gap: 2rem;
    }

    .cart-bar {
        position: fixed;
        top: 50%;
        right: 0;
        bottom: auto;
        left: auto;
        width: auto;
        transform: translateY(-50%);
        flex-direction: column;
        justify-content: flex-start;
        background: none;
        box-shadow: none;
        padding: 0;
    }

    .cart-bar .cart-link {
        border-radius: 20px 0 0 20px;
        background: var(--primary-color);
        color: #fff !important;
        padding: 12px 24px;
        text-align: left;
        box-shadow: -4px 6px 15px rgba(0,0,0,0.15);
        transition: background 0.3s ease, transform 0.2s ease;
        margin-top: 8px;
    }

    .cart-bar .cart-link:hover {
        background: var(--primary-dark);
        transform: translateX(-5px);
    }
}

/* --- MOBILE VIEW RESPONSIVENESS --- */
@media (max-width: 600px) {
    .header-inner {
        padding-top: 35px;
    }

    .back-link {
        top: 0;
        left: 50%;
        transform: translateX(-50%);
        font-size: 0.85rem;
        padding: 5px 12px;
    }

    .back-link:hover {
        transform: translateX(-50%);
    }
}