/**
 * File: /shared/css/product-cards.css
 * Purpose: Shared product card structure, responsive layout, pricing,
 *          product information, and supporting presentation.
 *
 * Defines the reusable product card component across the Signs Platform.
 *
 * Product image sizing belongs in:
 * - /shared/css/product-images.css
 *
 * Product option controls belong in:
 * - /shared/css/product-options.css
 *
 * Brand-specific visual values are supplied through CSS custom properties.
 *
 * Dependencies:
 * - /shared/css/tokens.css
 * - /brand/{brand}/css/tokens.css
 * - /shared/css/product-images.css
 *
 * This file must not contain:
 * - Hard-coded brand-specific colors
 * - Product data
 * - Product availability logic
 * - JavaScript behavior
 */


/* ==========================================
   PRODUCT CARD
   ========================================== */

   #home_section .product-card {
    display: flex;
    flex-direction: column;

    width: 100%;
    max-width: 900px;

    margin: 0 auto 20px;
    padding: 15px;

    background-color: var(
        --brand-surface,
        var(--color-surface)
    );

    border: 1px solid var(
        --brand-accent,
        var(--color-border)
    );

    border-radius: 5px;

    box-shadow: var(--shadow-md);
}


/* ==========================================
   PRODUCT HEADER
   ========================================== */

#home_section .product-header {
    width: 100%;

    margin-bottom: 5px;

    text-align: center;
}

#home_section .product-header h5 {
    margin: 0;

    font-size: 1.5rem;
    font-weight: bold;
}


/* ==========================================
   PRODUCT BODY
   ========================================== */

   #home_section .product-body {
    display: flex;
    flex-direction: row;
    align-items: flex-start;

    width: 100%;
    min-width: 0;

    gap: 30px;
}

/* ==========================================
   PRODUCT DETAILS
   ========================================== */

   #home_section .product-details {
    flex: 1;
    min-width: 0;

    display: flex;
    flex-direction: column;
    justify-content: space-between;

    padding: 7px;
}

#home_section .product-info {
    width: 100%;
    min-width: 0;

    font-size: inherit;
    line-height: 1.5;
}


/* ==========================================
   PRODUCT CARD DIVIDERS
   ========================================== */

#home_section .product-card > hr {
    display: block;

    width: 100%;
    max-width: 100%;

    box-sizing: border-box;

    border: 0;
    border-top: 1px solid var(
        --brand-accent,
        var(--color-border)
    );
}

#home_section .product-header + hr {
    margin-top: 0;
}


/* ==========================================
   PRODUCT INFORMATION DIVIDER
   ========================================== */

#home_section .product-info > hr {
    display: block;

    width: 100%;
    max-width: 100%;

    margin: 1rem 0;

    box-sizing: border-box;

    border: 0;
    border-top: 1px solid var(
        --brand-accent,
        var(--color-border)
    );
}


/* ==========================================
   PRODUCT FOOTER
   ========================================== */

#home_section .product-footer {
    width: 100%;

    text-align: center;
}

#home_section .product-footer .product-actions {
    display: flex;
    justify-content: center;

    width: 100%;
}

#home_section .product-footer button.customize,
#home_section .product-footer button.add-to-cart {
    width: 100%;
}


/* ==========================================
   PRODUCT PRICE
   ========================================== */

#home_section .product-price {
    color: var(
        --brand-price,
        var(--brand-selection, var(--color-text))
    );

    font-size: 26px;
    text-align: right;
}

#home_section .price-sup {
    color: var(
        --brand-price,
        var(--brand-selection, var(--color-text))
    );

    font-size: 12px;
    vertical-align: super;
}

#home_section .product-price .text-small {
    display: inline;

    margin-left: 5px;

    font-size: 60%;
    opacity: 0.8;
}


/* ==========================================
   SUPPORTING TEXT
   ========================================== */

.text-small {
    display: inline-block;

    color: inherit;

    font-size: 90%;
    font-weight: bold;

    opacity: 0.8;

    vertical-align: baseline;
}


/* ==========================================
   PRODUCT PRICING VISIBILITY
   ========================================== */

.product-pricing-not-mobile {
    display: block;
}

.product-pricing-mobile {
    display: none;
}


/* ==========================================
   FLAGS
   ========================================== */

.flags-container {
    display: flex;
    align-items: center;
    justify-content: center;

    gap: 8px;
    margin-top: 1rem;
}

#home_section .flags-container img {
    width: 24px;
    height: auto;
}

.flag {
    width: 50px;
    height: auto;
}


/* ==========================================
   PRODUCT ID
   ========================================== */

/*
 * Preserve the existing visual hiding behavior.
 *
 * This should eventually be replaced by removing the product ID
 * from presentation markup rather than hiding it with color.
 */
#home_section .product-id {
    color: var(--color-surface);
}


/* ==========================================
   MOBILE
   ========================================== */

@media (max-width: 767px) {
    #home_section .product-body {
        flex-direction: column;

        gap: 10px;
    }

    #home_section .product-image-container {
        flex: none;
    
        width: 100%;
        max-width: 100%;
    }
    
    #home_section .product-details {
        flex: none;
    
        width: 100%;
        min-width: 0;
    }
    
    #home_section .product-info {
        width: 100%;
    }
    
    #home_section .product-header {
        width: 100%;

        margin-bottom: 0;

        text-align: center;
    }

    #home_section .product-header .product-name {
        font-size: 1rem;
        line-height: 1.4;
        text-align: center;
    }

    #home_section .product-card .product-price {
        margin-bottom: 0.5rem;

        text-align: center;
    }

    #home_section .product-card .row.align-items-center {
        flex-direction: column;
    }

    .product-pricing-not-mobile {
        display: none;
    }

    .product-pricing-mobile {
        display: flex;
        flex-direction: row;
        justify-content: center;

        width: 100%;
    }
}


/* ==========================================
   TABLET AND DESKTOP
   ========================================== */

@media (min-width: 768px) {
    .product-pricing-mobile {
        display: none !important;
    }
}


/* ==========================================
   TABLET
   ========================================== */

@media (min-width: 768px) and (max-width: 1024px) {
    #home_section .product-body {
        display: flex;
        flex-direction: row;
        align-items: flex-start;

        gap: 30px;
    }
}

/* ==========================================
   DESKTOP
   ========================================== */

   @media (min-width: 1025px) {
    /*
     * The card itself always remains vertically structured:
     *
     *   Header
     *   Divider
     *   Body
     *   Footer
     *
     * Only the product body uses a horizontal layout.
     */
    #home_section .product-card {
        flex-direction: column;
        align-items: stretch;
    }

    /*
     * Image and product details appear side-by-side
     * within the product body on desktop.
     */
    #home_section .product-body {
        display: flex;
        flex-direction: row;
        align-items: flex-start;

        width: 100%;

        gap: 30px;
    }

    #home_section .product-footer button.customize,
    #home_section .product-footer button.add-to-cart {
        width: 33.333% !important;
        max-width: 33.333%;
    }
}