﻿/* ==========================================================================
   app.css — Global layout styles extracted from layouts/app.blade.php
   Load order: BEFORE bootstrap.min.css (prevents FOUC)
   ========================================================================== */

html,
body {
    background: #F2DDCC;
    margin: 0;
    padding: 0;
}

/* Match body background to gradient start on product listing pages
   so no white flash appears below fixed header during fast scroll */
body:has(.category-page-top),
body:has(.subcategory-page-top),
body:has(.h-top) {
    background-color: #F2DDCC;
}


@media (max-width: 1200px) {
    .category-page-top,
    .subcategory-page-top {
        margin-top: 20px !important;
    }
}

body {
    visibility: visible;
    opacity: 1;
}

/* Hide AOS-animated elements until aos.js initialises */
[data-aos] {
    opacity: 0;
    transition-property: opacity, transform;
}

[data-aos].aos-animate {
    opacity: 1;
}

.main-background-gradient {
    background: linear-gradient(180deg, #fff7e6 0%, #ffffff 100%);
}

/* Product card – prevents layout shift before CSS fully loads */
.product-card-img {
    overflow: hidden;
    border-radius: 10px 10px 0 0;
    width: 100%;
    height: 200px;
    position: relative;
    display: block;
}

@media (max-width: 575.98px) {
    .product-card-img { height: 130px; }
}

/* subcategory-products image wrapper */
.c-img {
    overflow: hidden;
    border-radius: 10px 10px 0 0;
    width: 100%;
    height: 150px;
    position: relative;
    display: block;
}

@media (max-width: 575.98px) {
    .c-img { height: 110px; }
}

.c-img a {
    display: block;
    width: 100%;
    height: 100%;
}

.c-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
}

.product-card-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
}

/* Reduce gap between product image and name — desktop only */
@media (min-width: 576px) {
    .product-card .rounded-bottom.custom-text-color {
        padding-top: 0.5rem !important;
    }
}

.product .product-card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.product .product-card .product-img {
    overflow: hidden;
    border-radius: 10px 10px 0 0;
    width: 100%;
    height: 0;
    padding-bottom: 127.6%;
    position: relative;
}

.product .product-card .product-img img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* Admin inline editing */
.editable-inline[contenteditable="true"] {
    outline: 2px dashed rgba(4, 29, 59, 0.35);
    outline-offset: 4px;
    border-radius: 4px;
}

.editable-inline[contenteditable="true"]:focus {
    outline-color: #041D3B;
    background: rgba(4, 29, 59, 0.05);
}

.editable-save-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 2000;
    background: #041D3B;
    color: #fff;
    padding: 10px 14px;
    border-radius: 6px;
    display: none;
}

.editable-error-toast {
    background: #dc3545 !important;
}

/* WhatsApp FAB – hidden until JS opens it */
.wa-fab-panel {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.wa-fab-panel.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}
