/**
 **** AppzStory Shopping Cart System PHP MySQL ****
 * 
 * @link https://appzstory.dev
 * @author Yothin Sapsamran (Jame AppzStory Studio)
 */
 
 html {
    filter: grayscale(10%) brightness(95%);
 }
 
html body {
    font-family: 'Prompt', sans-serif;
    font-size: 0.85rem;
}
.flex-container {
    display: flex;
    align-items: center;
    justify-content: center;
    /* min-height: 100vh; */
    background-color: #fff;
}
.text-pink {
    color: #FF5656;
}

.img-cover{
    height: 230px;
    object-fit: cover;
    max-width: 100%;
}
.brand-center {
    align-items: center;
    display: flex;
    font-size: 0.85rem;
}

.z-10{
    z-index: 10;
}

input[type=number]{
    width: 60px;
}

/* Custom CSS to create 1:1 image card */
.square-card {
    position: relative;
    width: 100%;
    padding-top: 100%; /* 1:1 aspect ratio */
}
.square-card img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

body.modal-open {
    overflow: hidden !important;
}


.btn-select {
    overflow: visible;
    cursor: pointer;
    min-width: 5rem;
    min-height: 2.5rem;
    box-sizing: border-box;
    padding: 0.5rem 0.75rem;
    margin: 6px 6px 0 0;
    color: rgba(0,0,0,.8);
    text-align: left;
    border-radius: 20px;
    border: 1.5px solid #dee2e6;
    position: relative;
    background: #fff;
    outline: 0;
    word-break: break-word;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    transition: all 0.2s ease;
}

.btn-select:hover {
    color: #fff;
    background: linear-gradient(135deg, #0d6efd, #6610f2);
    border-color: transparent;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(13,110,253,0.3);
}

.btn-select.active {
    color: #fff !important;
    background: linear-gradient(135deg, #0d6efd, #6610f2) !important;
    border-color: transparent !important;
    box-shadow: 0 3px 10px rgba(13,110,253,0.35);
}

.btn-not:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    min-width: 5rem;
    min-height: 2.5rem;
    border-radius: 2px;
    border: 1px solid rgba(0,0,0,.09);
}

.btn-select.btn-sold-out {
    opacity: 0.45;
    text-decoration: line-through;
    background: #f8f9fa;
}

.btn-select.btn-sold-out.active {
    background: #6c757d !important;
    opacity: 0.7;
}


.showImgOption {
    width: 1.5rem;
    height: 1.5rem;
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
}

.btn-number {
    font-size: 14px;
    font-weight: bold;
    min-height: 2.5rem;
    border-radius: 8px;
    border: 1.5px solid #dee2e6;
    padding: 0 14px;
    background: #fff;
    transition: all 0.15s ease;
}

.btn-number:hover {
    background: #0d6efd;
    color: #fff;
    border-color: #0d6efd;
}

.btn-number:disabled {
    color: #adb5bd;
    background-color: #f8f9fa;
    opacity: 0.6;
    cursor: not-allowed;
    min-height: 2.5rem;
    border-radius: 8px;
    border: 1.5px solid #dee2e6;
}

.text-none{
    text-decoration: none !important;
}
.pointer{
    cursor: pointer;
}

.input-group-height{
    height: 40px;
}

/* Customize title font size to be smaller */
.swal2-title {
  font-size: 16px; /* You can adjust the font size as needed */
}

#display_name{
    font-size: 12px;
}


.sticky-top {
    top: -2px;
}


.my-spacing{
    letter-spacing: 2px;
}


/***   */
#uploadImage {
    opacity: 0;
    position: absolute;
    z-index: -1;
  }
  
  .upload-box {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    width: 100%;
    padding-bottom: 100%;
    border: 1px dashed #1b3ceb;
    border-radius: 15px;
    overflow: hidden;
    cursor: pointer;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center center;
  }
  
  .upload-box img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
  }
  
  .upload-box:hover {
    background-color: #cecccc;
  }
  
  
  .upload-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 16px;
    color: #aaa;
    text-align: center;
    width: 100%;
    z-index: 1;
  }
  
  .btn-line{
    display: block;
    background-color: #00b900;
  }


  .sidebar-box {
    font-size: 15px;
    width: 100%;
    float: left;
    background: transparent;
  }
  
  .search-form-wrap {
    display: block;
  }
  
  .search-form .form-group {
    position: relative;
  }

  .search-form .form-group #search {
    padding-right: 50px;
    background: #f7f7f7;
    border: none;
    border-radius: 20px;
  }

  .search-form .icon {
    position: absolute;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
  }

/* Out of Stock Overlay */
.out-of-stock-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.out-of-stock-label {
    color: #fff;
    font-size: 1.6rem;
    font-weight: bold;
    letter-spacing: 4px;
    background: rgba(0, 0, 0, 0.55);
    padding: 10px 32px;
    border-radius: 6px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

/* Banner across image center (modal) */
.out-of-stock-banner {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 1.4rem;
    font-weight: bold;
    letter-spacing: 6px;
    text-align: center;
    padding: 12px 0;
    z-index: 3;
    text-shadow: 0 2px 6px rgba(0,0,0,0.6);
}

.img-out-of-stock {
    filter: grayscale(60%);
}

/* Modal Product Styles */
.modal-product {
    border: none;
    border-radius: 16px;
    overflow: hidden;
}

.modal-header-gradient {
    background: linear-gradient(135deg, #0d6efd 0%, #6610f2 100%);
    border-bottom: none;
    padding: 12px 16px;
}

.modal-product-img {
    max-width: 350px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.modal-product-img:hover {
    transform: scale(1.02);
}

/* Add to Cart Button */
.btn-add-cart {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
    transition: all 0.25s ease;
    box-shadow: 0 4px 12px rgba(40,167,69,0.3);
}

.btn-add-cart:hover {
    background: linear-gradient(135deg, #218838 0%, #1dad87 100%);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40,167,69,0.4);
}

.btn-add-cart:active {
    transform: translateY(0);
}

.btn-add-cart:disabled {
    opacity: 0.7;
    transform: none;
    box-shadow: none;
}

/* Input Number */
.input-number {
    text-align: center;
    width: 50px;
    padding: 5px;
    border-radius: 0;
    font-weight: 600;
    font-size: 1rem;
    border: 1.5px solid #dee2e6;
}

/* Toast Styles */
#toastContainer {
    max-width: 320px;
}

.toast-custom {
    min-width: 260px;
    max-width: 320px;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    animation: slideInRight 0.35s ease-out;
    border-left: 4px solid #28a745;
}

.toast-icon-wrap {
    flex-shrink: 0;
}

.toast-cart-count {
    position: relative;
    flex-shrink: 0;
    margin-left: 8px;
    font-size: 1.1rem;
    color: #0d6efd;
}

.toast-cart-badge {
    position: absolute;
    top: -8px;
    right: -10px;
    background: #dc3545;
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    width: 16px;
    height: 16px;
    line-height: 16px;
    text-align: center;
    border-radius: 50%;
    animation: badgePop 0.4s ease;
}

/* Cart Badge Bounce Animation */
.cart-badge-bounce {
    animation: badgePop 0.5s ease !important;
}

@keyframes badgePop {
    0% { transform: scale(1); }
    30% { transform: scale(1.6); }
    50% { transform: scale(0.85); }
    70% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Mobile Responsive */
@media (max-width: 576px) {
    #toastContainer {
        left: 50% !important;
        right: auto !important;
        transform: translateX(-50%);
        max-width: 92vw;
        padding: 8px !important;
    }

    .toast-custom {
        min-width: unset;
        max-width: 100%;
        font-size: 0.8rem;
    }

    .modal-product-img {
        max-width: 100%;
        border-radius: 8px;
    }

    .btn-select {
        min-width: 4rem;
        min-height: 2.2rem;
        padding: 0.35rem 0.6rem;
        margin: 4px 4px 0 0;
        font-size: 0.78rem;
    }

    .btn-add-cart {
        font-size: 0.88rem;
        padding: 10px !important;
    }

    .modal-header-gradient {
        padding: 10px 14px;
    }

    .modal-header-gradient .modal-title {
        font-size: 0.85rem !important;
    }
}

/* ====================== */
/* Carousel Product Image */
/* ====================== */
.carousel-product-img {
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 8px;
}

/* Dotted indicators */
.carousel-dots button {
    width: 10px !important;
    height: 10px !important;
    border-radius: 50% !important;
    border: none !important;
    background-color: rgba(0,0,0,0.25) !important;
    transition: all 0.3s ease;
    margin: 0 4px !important;
}
.carousel-dots button.active {
    background-color: #0d6efd !important;
    transform: scale(1.25);
}

/* Thumbnail strip */
.carousel-thumbnails {
    padding: 0 4px;
}
.carousel-thumb {
    width: 52px;
    height: 52px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid transparent;
    cursor: pointer;
    opacity: 0.55;
    transition: all 0.25s ease;
}
.carousel-thumb:hover {
    opacity: 1;
    transform: scale(1.08);
}
.carousel-thumb.active {
    opacity: 1;
    border-color: #0d6efd;
    box-shadow: 0 0 0 2px rgba(13,110,253,0.25);
}

/* ========================= */
/* Floating CTA Button       */
/* ========================= */
.floating-cta-wrap {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1040;
    display: flex;
    justify-content: center;
    padding: 12px 16px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    pointer-events: none;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.35s ease, transform 0.35s ease;
}
.floating-cta-wrap.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
.floating-cta-btn {
    max-width: 420px;
    width: 100%;
    padding: 14px 24px;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    border: none;
    border-radius: 50px;
    box-shadow: 0 6px 24px rgba(40,167,69,0.45);
    letter-spacing: 0.2px;
    transition: all 0.25s ease;
}
.floating-cta-btn:hover {
    background: linear-gradient(135deg, #218838 0%, #1dad87 100%);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(40,167,69,0.55);
}
.floating-cta-btn:active {
    transform: translateY(0);
    box-shadow: 0 4px 16px rgba(40,167,69,0.35);
}

/* Extra bottom padding so floating CTA doesn't cover content */
#footer {
    padding-bottom: 80px;
}

@media (max-width: 576px) {
    .carousel-thumb {
        width: 44px;
        height: 44px;
        border-radius: 6px;
    }
    .floating-cta-btn {
        font-size: 0.92rem;
        padding: 12px 20px;
    }
}