/* Main container for category content */
/* Responsive for Masonry Categories */
.categories-container {
    width: 100%;
    margin: 20px auto;
    background: transparent;
    box-sizing: border-box;
}

.category-content-container {
    width: 100% !important;
    max-width: 100%;
    margin: 0 auto 20px auto !important;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: stretch;

    height: fit-content;
    padding: 5px;

    background: radial-gradient(
        circle at right,
        rgba(0, 0, 0, 0) 0%,
        rgba(0, 0, 0, 0.1) 50%,
        rgba(0, 0, 0, 0.4) 70%,
        rgba(0, 0, 0, 0.7) 85%,
        rgba(0, 0, 0, 1) 100%
    );
    color: white;

    border-radius: 0 0 12px 12px;
    border-top: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);

    position: relative;
    z-index: 1;
}

.category-content-collapsed {
    display: none !important;
}




/* Subcategory links container */
.subcategory-links {
    display: flex;
    flex-direction: column;   /* default: stack vertically */
    gap: 10px;
    width: 20%;
    padding: 10px;
    margin-right: 10px;
}

/* Subcategory item */
.subcategory {
    background-color: rgba(255, 255, 255, 0.82);
    border: var(--bsc-card-border);

    min-width: fit-content;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    padding: 10px;
    width: 100%;              /* fill container when vertical */
    box-sizing: border-box;
}

/* Switch to horizontal row when container is narrow */
@media (max-width: 950px) {
    .subcategory-links {
        flex-direction: row;   /* switch from column → row */
        flex-wrap: wrap;       /* allow multiple rows if needed */
        width: 100%;           /* span full width */
        margin-right: 0;
        justify-content: flex-start; /* align neatly to left */
    }

    .subcategory {
        flex: 0 1 auto;        /* items shrink nicely */
        width: auto;           /* no forced full width */
        min-width: 150px;      /* keep them readable */
    }
}







.category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin: 0 auto 0 auto; /* top=0, auto sides, bottom=0 */

    background: #fff;
    color: #222;
    text-decoration: none;
    text-wrap: wrap;

    border: var(--bsc-card-border);
    border-bottom: none;
    border-radius: 12px 12px 0 0;

    padding: 0.5em 1.2em;
    font-size: 1.5em;
    font-weight: bold;

    position: relative;
    z-index: 2;
}

.cart-table-container {
    background: radial-gradient(
        circle at right,
        rgba(0, 0, 0, 0) 0%,
        rgba(0, 0, 0, 0.1) 50%,
        rgba(0, 0, 0, 0.4) 70%,
        rgba(0, 0, 0, 0.7) 85%,
        rgba(0, 0, 0, 1) 100%
    );
    color: #fff;
    width: 100%;
    overflow-x: auto;
    box-sizing: border-box;
}

/* Flexbox layout for content */
.category-content {
    width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}






.subcategory h2 {
    display: block;           /* Ensures it fills the width */
    width: 100%;  
    min-width: fit-content;            /* Full width of parent */
    box-sizing: border-box;   /* Includes padding/border in width */
    margin: 0 auto;           /* Center if needed */
    padding: 8px 0;           /* Adjust as needed */
    color: black;
    text-decoration: none;
    border-radius: 4px 4px;
}



/* Subcategory links (e.g., Shirts, Pants) */
.subcategory > a {
    font-weight: bold;

    text-decoration: underline;
}

.subcategory > a:hover {
    text-decoration: underline;
}

/* Product list under each subcategory */
.product-list {
    padding-left: 24px;
    margin-top: 8px;
    list-style-type: disc;
}

/* Bullet points for products */
.product-list li {
    list-style-type: disc;
    margin-bottom: 6px;
    color: #222;
}

/* Product links: use browser default link color, no background, no shadow */
.product-list a {
    background: transparent ;
    box-shadow: none ;
    border-radius: 0;
    margin-top: 0;
    padding: 0;

    text-decoration: underline;
    font-weight: normal;
    display: inline;
    transition: text-decoration 0.2s;
}

.product-list a:hover {
    background: transparent ;
    text-decoration: underline;
    /* No color property here either */
    transform: none;
    box-shadow: none;
}

/* Right panel for product cards */
.right-panel {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    flex: 1 1 800px;
    display: flex;
    flex-direction: column;
  
    gap: 20px;
}

/* Product card container */
.product-card {
    position: relative;
    width: 98%;
    max-width: 98%;
    margin: 0 auto;
    box-sizing: border-box;
    height: 600px;

    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;


    background: rgba(255, 255, 255, 0.82);
    border: var(--bsc-card-border);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    z-index: 1;
}

/* Floating product image container */
.product-card img {
    width: 99%;
    height: 99%;
    padding:10px;
    max-width: 99%;
    max-height: 99%;
    object-fit: contain;
    margin: 0 auto;
    display: block;
    background: #222;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.18);
}

/* Portrait images: height fills, width auto */
.product-card img.portrait {
    width: auto !important;
    height: 99% !important;
    max-height: 99%;
    max-width: 98%;
    object-fit: contain;
}

/* Landscape images: width fills, height auto */
.product-card img.landscape {
    width: 99% !important;
    height: auto !important;
    max-width: 99%;
    max-height: 98%;
    object-fit: contain;
}

/* When hovering card, slide tab down and then show info */
.product-card:hover .more-info-tab {
    /* Move tab further down so it appears to slide out of view */
    transform: translate(-50%, 140%);
    opacity: 0;
    pointer-events: none;
}


/* More Info Tab always visible, slides down on hover */
.more-info-tab {
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translate(-50%, 0);
    background: rgba(255,255,255,0.85);
    color: #222;
    padding: 8px 28px 8px 28px; /* Slimmer tab */
    border-radius: 18px 18px 0 0; /* Rounded top corners */
    border: none; /* No border */
    font-size: 1.02em;
    font-weight: 600;
    letter-spacing: 0.5px;
    box-shadow: 0 -2px 8px rgba(144, 143, 143, 0.133);
    cursor: pointer;
    opacity: 1;
    transition: transform 0.35s cubic-bezier(.4,0,.2,1), opacity 0.35s cubic-bezier(.4,0,.2,1);
    z-index: 10;
    pointer-events: auto;
    user-select: none;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}


/* Product info box is hidden by default, slides up after tab slides down */
.product-info {
    position: absolute;            /* Important for overlapping */
    bottom: 0; 
    width: 100%;
    
    margin:0 auto;
    align-items: center;
    height: 0;
    overflow: hidden;
    opacity: 0;
    background: rgba(255, 255, 255, 0.9);
    border-top: 3px solid #000;
    transition: height 0.4s ease, opacity 0.3s ease 0.1s;
    z-index: 3;                    /* Make sure it's above image */
}


.product-card:hover .product-info,
.product-info.open {


    opacity: 1;
}


.product-description {
    white-space: pre-line; /* preserve line breaks */
    color: white;
    background: transparent;
    font-size: 1.1em;
    margin: 0 auto;
    text-align: left;
    padding: 0;
}

/* Product name styling */
.product-name {
    font-size: 1.2em;
    font-weight: bold;
    margin-bottom: 5px;
}

/* Product price styling */
.product-price {
    margin: 5px 0;
    padding: 4px 8px;
    display: inline-block;
    border-radius: 4px;
    font-weight: bold;
}


.product-description-box {

    height: fit-content;
    margin: 0 auto;
    align-content: center;
    background-color: rgba(0, 0, 0, 0.505);
    width: 100%;

}


.product-description {
    color: black;
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
    font-size: 2rem;
    margin: 0;
    text-align: center;
    padding: 0;
    height: fit-content

}

#floating-product-link{
    background-color: rgba(0, 255, 255, 0);

}

/* Product details links */
.product-details a {
    display: inline-block;
    margin-top: 3px;
    text-decoration: none;
}

.product-details a:hover {
    text-decoration: underline;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, auto));
    gap: 20px;
    justify-content: start; /* or center if you want them centered */
}


/* Responsive: decrease columns as screen gets smaller or user zooms in */
@media (max-width: 1400px) {
    .categories-container,
    .category-content-container {
        max-width: 100%;
    }
    .product-card {
        width: 100%;
        max-width: 100%;
        height: 600px;
    }
}
@media (max-width: 900px) {
    .categories-container,
    .category-content-container {
        max-width: 100%;
        padding: 2px;
    }
    .product-card {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        height: 400px;
    }
}
@media (max-width: 600px) {
    .categories-container,
    .category-content-container {
        max-width: 100%;
        padding: 0;
    }
    .product-card {
        width: 100%;
        max-width: 100%;
        height: 220px;
    }
    .category-header {
        font-size: 1em;
        padding: 0.4em 0.8em;
    }
    .toggle-btn {
        width: 36px;
        height: 36px;
        font-size: 1.2em;
    }
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 10px;
    }
    .grid-item {
        max-width: 100%;
        padding: 8px;
    }
    .grid-item img {
        height: 160px;
    }
}

/* Touch devices — make more-info-tab tappable and always visible */
@media (hover: none), (pointer: coarse) {
    .more-info-tab {
        opacity: 1;
        pointer-events: auto;
    }
    .product-card:hover .more-info-tab {
        transform: translate(-50%, 0);
        opacity: 1;
        pointer-events: auto;
    }
    .product-info.open {
        opacity: 1;
    }
}

/* Grid item styling */
.grid-item {
    background-color: rgba(255, 255, 255, 0.82);
    border: var(--bsc-card-border);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    border-radius: 8px;    
    padding: 15px;
    text-align: center;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s ease;

    max-width: 200px;


}

/* Subtle highlight for selected (active) grid item */
.grid-item.active-grid-item {
    background-color: #eaffea ;
    border-color: #00ff62 ;
    box-shadow: 0 0 0 3px #00ff6240;
    transition: background 0.3s, border-color 0.3s, box-shadow 0.3s;
}


.grid-item:hover {
    transform: scale(1.02);
}

.grid-item img {

    width:98%;
    height:250px;

    object-fit: contain;   /* keep aspect ratio, show full image */
    border-radius: 6px;
    margin-bottom: 10px;
    background-color: #202020; /* optional: fill empty space */
}

.grid-item h3 {
    display: block;           /* Ensures it fills the width */
    width: 100%;              /* Full width of parent */
    box-sizing: border-box;   /* Includes padding/border in width */
    margin: 0 auto;           /* Center if needed */
    padding: 8px 0;           /* Adjust as needed */
    color: black;
    text-decoration: none;
    border-radius: 4px 4px;

    font-size: large;
}


.grid-item p {
    margin: 0;
    color: #000000;
}

.grid-item a {
    display: inline-block;
    margin-top: 8px;
    padding: 6px 12px;
    background-color: #f0f0f0;

    text-decoration: none;
    border-radius: 4px;
}

.grid-item a:hover {
    background-color: #e0e0e0;
    text-decoration: underline;
}

/* --- Floating Product Info Table Styles (Refactored) --- */
.floating-product-info-table {
    border-collapse: collapse;
    width: 100%;
    margin: 0 auto;
    font-size: 1em;
    background: #ffffff;
    color: #222;
    border-radius: 8px;
    border: 2px solid #b6b6b6;
    box-shadow: 0 2px 8px #b6b6b633;
    table-layout: fixed;
    transition: width 0.3s;
}


.floating-product-info-table caption {
    padding: 6px 0 8px 0;
    font-size: 1.1em;
    font-weight: bold;
    color: var(--bsc-green);
    background: var(--bsc-table-header);
    border-bottom: 2px solid #b6b6b6;
    letter-spacing: 1px;
}

/* Combine th and td for shared cell styles */
.floating-product-info-table th,
.floating-product-info-table td,
#floating-product-description-table {
    padding: 8px 12px;
    border: 1px solid #b6b6b6;
    text-align: left;
    vertical-align: top;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    word-break: break-word;
    white-space: normal;
    overflow-wrap: break-word;
    background: rgba(255, 255, 255, 0.82);
    color: #222;
}

/* th-specific overrides */
.floating-product-info-table th {
    font-weight: bold;
    color: var(--bsc-green);
    width: 30%;
}

/* Even row backgrounds */
.floating-product-info-table tr:nth-child(even) td,
.floating-product-info-table tr:nth-child(even) th {
    background: #f6f9f6;
}

/* Last row bottom border */
.floating-product-info-table tr:last-child td,
.floating-product-info-table tr:last-child th {
    border-bottom: 2px solid #b6b6b6;
}

/* Description table width */
#floating-product-description-table {
    width: 100%;
}

/* Media Query for mobile responsiveness */
@media (max-width: 768px) {
    .category-content {
        flex-direction: column;
    }

    .subcategory-links,
    .right-panel {
        flex: 1 1 100%;
    }

    .product-card {
        width: 98%;
        height: auto;
        min-height: 320px;
        max-width: 100%;
    }

    .product-card img {
        height: 200px;
    }

    .grid-item img,
    .product-card img {
        max-width: 100%;
        height: auto;
        object-fit: contain;
    }
}

/* PayPal category section: disabled by default, enabled when preview state is active */
.paypal-section {
    width: 100%;
    max-width: 100%;
    margin: 12px auto;
    box-sizing: border-box;
    transition: max-height 0.35s ease, opacity 0.25s ease, transform 0.25s ease;
    overflow: hidden;
    pointer-events: none; /* prevent interaction when disabled */
    opacity: 0.45;
    max-height: 0.6rem; /* effectively collapsed when disabled */
    border: 5px solid rgba(0,0,0,0.15);
    background: rgba(255,255,255,0.92);
    border-radius: 8px;
}

/* enabled state — expand and accept pointer events */
.paypal-section.enabled {
    pointer-events: auto;
    opacity: 1;
    max-height: 800px; /* allow content to show; adjusted to suit layout */
    transform: translateY(0);
}

/* small inner spacing when visible */
.paypal-section .paypal-content {
    padding: 12px;
}

/* make PayPal buttons area comfortable */
#paypal-button-container {
    margin: 6px 0 12px 0;
}

/* result message styling */
#result-message {
    margin-top: 8px;
    font-size: 0.95rem;
    color: var(--bsc-green);
}





