﻿/* =========================================================
                           EL GALPÓN - PRODUCT CATALOG
                           ========================================================= */
:root {
    --galpon-red: #E00000;
    --galpon-red-dark: #B80000;
    --galpon-black: #000000;
    --galpon-gray: #666666;
    --galpon-light: #F5F5F5;
    --galpon-border: #E5E5E5;
    --galpon-white: #FFFFFF;
}


/* =========================================================
                           PAGE
                           ========================================================= */

.store-page {
    min-height: 100vh;
    background: #FAFAFA;
    color: var(--galpon-black);
}


/* =========================================================
                           PAGE HEADING
                           ========================================================= */

.page-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 25px;
    gap: 30px;
}


.section-label {
    display: block;
    color: var(--galpon-red);
    font-size: .75rem;
    font-weight: 800;
    letter-spacing: 2px;
    margin-bottom: 5px;
}


.page-heading h1 {
    font-size: 2.3rem;
    font-weight: 800;
    margin: 0;
    letter-spacing: -1px;
}


/* =========================================================
                           HEADING ACTIONS
                           ========================================================= */

.heading-actions {
    display: flex;
    align-items: center;
    gap: 25px;
}


.product-count {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    color: var(--galpon-gray);
    font-size: .85rem;
}


    .product-count strong {
        color: var(--galpon-black);
        font-size: 1.5rem;
        line-height: 1;
    }


/* =========================================================
                           VIEW SWITCHER
                           ========================================================= */

.view-switcher {
    display: flex;
    background: white;
    border: 1px solid var(--galpon-border);
    border-radius: 7px;
    padding: 3px;
}


.view-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-width: 82px;
    height: 38px;
    border: none;
    border-radius: 5px;
    background: transparent;
    color: var(--galpon-gray);
    font-size: .8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all .2s ease;
}


    .view-btn:hover {
        color: var(--galpon-black);
    }


    .view-btn.active {
        background: var(--galpon-black);
        color: white;
    }


/* =========================================================
                           GRID ICON
                           ========================================================= */

.view-icon {
    display: grid;
    grid-template-columns: repeat(2, 5px);
    grid-template-rows: repeat(2, 5px);
    gap: 2px;
}


    .view-icon span {
        width: 5px;
        height: 5px;
        border: 1px solid currentColor;
    }


/* =========================================================
                           LIST ICON
                           ========================================================= */

.list-icon {
    display: flex;
    flex-direction: column;
    gap: 3px;
}


    .list-icon span {
        display: block;
        width: 14px;
        height: 2px;
        background: currentColor;
        border-radius: 2px;
    }


/* =========================================================
                           SEARCH TOOLBAR
                           ========================================================= */

.catalog-toolbar {
    margin-bottom: 30px;
}


.search-form {
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 720px;
}


.search-input-wrapper {
    position: relative;
    flex: 1;
}


.search-input {
    width: 100%;
    height: 46px;
    padding: 0 45px 0 42px;
    border: 1px solid #D5D5D5;
    border-radius: 7px;
    background: white;
    color: var(--galpon-black);
    font-size: .88rem;
    outline: none;
    transition: border-color .2s ease, box-shadow .2s ease;
}


    .search-input::placeholder {
        color: #999999;
    }


    .search-input:focus {
        border-color: var(--galpon-red);
        box-shadow: 0 0 0 3px rgba(224, 0, 0, .08);
    }


/* =========================================================
                           SEARCH ICON
                           ========================================================= */

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--galpon-gray);
    font-size: .95rem;
    pointer-events: none;
}


/* =========================================================
                           CLEAR SEARCH
                           ========================================================= */

.clear-search {
    position: absolute;
    right: 13px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--galpon-gray);
    text-decoration: none;
    font-size: 1.25rem;
    line-height: 1;
    border-radius: 50%;
    transition: background .2s ease, color .2s ease;
}


    .clear-search:hover {
        background: #F1F1F1;
        color: var(--galpon-black);
    }


/* =========================================================
                           SEARCH BUTTON
                           ========================================================= */

.search-button {
    height: 46px;
    padding: 0 22px;
    border: 1px solid var(--galpon-black);
    border-radius: 7px;
    background: var(--galpon-black);
    color: white;
    font-size: .85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all .2s ease;
}


    .search-button:hover {
        background: #333333;
        border-color: #333333;
        transform: translateY(-1px);
    }


/* =========================================================
                           SEARCH RESULTS
                           ========================================================= */

.search-result-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    color: var(--galpon-gray);
    font-size: .8rem;
}


    .search-result-info strong {
        color: var(--galpon-black);
    }


.result-count {
    padding: 3px 8px;
    background: #F1F1F1;
    border-radius: 20px;
    font-weight: 700;
}


/* =========================================================
                           PRODUCTS CONTAINER
                           ========================================================= */

.products-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
}


.product-wrapper {
    min-width: 0;
}


/* =========================================================
                           PRODUCT CARD
                           ========================================================= */

.product-card {
    height: 100%;
    background: var(--galpon-white);
    border: 1px solid var(--galpon-border);
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}


    .product-card:hover {
        transform: translateY(-5px);
        border-color: #D0D0D0;
        box-shadow: 0 12px 30px rgba(0, 0, 0, .10);
    }


/* =========================================================
                           PRODUCT IMAGE
                           ========================================================= */

.product-image-container {
    position: relative;
    height: 220px;
    background: #F1F1F1;
    overflow: hidden;
    flex-shrink: 0;
}


.product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .35s ease;
}


.product-card:hover .product-image {
    transform: scale(1.04);
}


/* =========================================================
                           STOCK BADGES
                           ========================================================= */

.stock-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
}


    .stock-badge.available {
        background: #FFFFFF;
        color: #222222;
    }


    .stock-badge.low {
        background: #FFFFFF;
        color: var(--galpon-red);
    }


    .stock-badge.out {
        background: var(--galpon-red);
        color: white;
    }


/* =========================================================
                           PRODUCT CONTENT
                           ========================================================= */

.product-content {
    display: flex;
    flex-direction: column;
    padding: 18px;
    flex: 1;
}


.product-main-info {
    flex: 1;
}


.product-name {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0 0 8px;
    color: var(--galpon-black);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


.product-price {
    color: var(--galpon-red);
    font-size: 1.35rem;
    font-weight: 800;
    margin-bottom: 12px;
}


/* =========================================================
                           STOCK
                           ========================================================= */

.product-stock {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 9px 0;
    margin-bottom: 15px;
    border-top: 1px solid #EEEEEE;
    border-bottom: 1px solid #EEEEEE;
    font-size: .85rem;
    color: var(--galpon-gray);
}


    .product-stock strong {
        color: var(--galpon-black);
    }


/* =========================================================
                           ACTION BUTTONS
                           ========================================================= */

.product-actions {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 6px;
    margin-top: auto;
}


    .product-actions .btn {
        font-size: .78rem;
        font-weight: 600;
        padding: 7px 4px;
        border-radius: 5px;
    }


/* View */

.btn-view {
    background: var(--galpon-black);
    border-color: var(--galpon-black);
    color: white;
}


    .btn-view:hover {
        background: #333333;
        border-color: #333333;
        color: white;
    }


/* Edit */

.btn-edit {
    background: white;
    border: 1px solid #BBBBBB;
    color: var(--galpon-black);
}


    .btn-edit:hover {
        background: var(--galpon-black);
        border-color: var(--galpon-black);
        color: white;
    }


/* Delete */

.btn-delete {
    background: white;
    border: 1px solid #CCCCCC;
    color: var(--galpon-red);
}


    .btn-delete:hover {
        background: var(--galpon-red);
        border-color: var(--galpon-red);
        color: white;
    }


/* =========================================================
                           LIST VIEW
                           ========================================================= */

.products-grid.list-view {
    display: flex;
    flex-direction: column;
    gap: 12px;
}


    .products-grid.list-view .product-wrapper {
        width: 100%;
    }


    .products-grid.list-view .product-card {
        height: 145px;
        min-height: 145px;
        display: grid;
        grid-template-columns: 145px 1fr;
        border-radius: 8px;
        transform: none !important;
    }


        .products-grid.list-view .product-card:hover {
            box-shadow: 0 6px 20px rgba(0, 0, 0, .08);
        }


    .products-grid.list-view .product-image-container {
        width: 145px;
        height: 145px;
    }


    .products-grid.list-view .product-content {
        display: grid;
        grid-template-columns: minmax(200px, 2fr) 150px 100px auto;
        align-items: center;
        column-gap: 25px;
        padding: 18px 22px;
    }


    .products-grid.list-view .product-main-info {
        display: contents;
    }


    .products-grid.list-view .product-name {
        font-size: 1.05rem;
        margin: 0;
    }


    .products-grid.list-view .product-price {
        margin: 0;
        font-size: 1.25rem;
    }


    .products-grid.list-view .product-stock {
        margin: 0;
        padding: 0;
        border-top: none;
        border-bottom: none;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 3px;
    }


        .products-grid.list-view .product-stock strong {
            font-size: 1rem;
        }


    .products-grid.list-view .product-actions {
        display: flex;
        gap: 6px;
        margin: 0;
    }


        .products-grid.list-view .product-actions .btn {
            min-width: 55px;
        }


/* =========================================================
                           OUT OF STOCK
                           ========================================================= */

.product-card.out-of-stock .product-image {
    filter: grayscale(100%);
    opacity: .75;
}


/* =========================================================
                           CREATE BUTTON
                           ========================================================= */

.btn-create {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--galpon-red);
    border: 2px solid var(--galpon-red);
    color: white;
    font-weight: 600;
    padding: 10px 18px;
    border-radius: 6px;
    text-decoration: none;
    transition: all .2s ease;
}


    .btn-create:hover {
        background: var(--galpon-red-dark);
        border-color: var(--galpon-red-dark);
        color: white;
        transform: translateY(-1px);
    }


/* =========================================================
                           ERROR
                           ========================================================= */

.custom-alert {
    background: #FFF2F2;
    border: 1px solid #F0B5B5;
    border-left: 4px solid var(--galpon-red);
    color: #7A0000;
    border-radius: 6px;
    margin-bottom: 30px;
}


/* =========================================================
                           EMPTY STATE
                           ========================================================= */

.empty-state {
    text-align: center;
    background: white;
    border: 1px solid var(--galpon-border);
    border-radius: 10px;
    padding: 70px 20px;
}


.empty-icon {
    font-size: 45px;
    margin-bottom: 15px;
}


.empty-state h2 {
    font-size: 1.5rem;
    font-weight: 700;
}


.empty-state p {
    color: var(--galpon-gray);
    margin-bottom: 25px;
}


/* =========================================================
                           RESPONSIVE - 1200px
                           ========================================================= */

@media (max-width: 1200px) {

    .products-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}


/* =========================================================
                           RESPONSIVE - 992px
                           ========================================================= */

@media (max-width: 992px) {

    .products-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }


        .products-grid.list-view .product-content {
            grid-template-columns: minmax(150px, 1fr) 120px 80px auto;
            column-gap: 15px;
        }
}


/* =========================================================
                           RESPONSIVE - 768px
                           ========================================================= */

@media (max-width: 768px) {

    .page-heading {
        align-items: flex-start;
    }


    .heading-actions {
        gap: 15px;
    }


    .product-count {
        display: none;
    }
    /* Search */

    .search-form {
        max-width: none;
    }
    /* List */

    .products-grid.list-view .product-card {
        height: auto;
        min-height: 130px;
        grid-template-columns: 120px 1fr;
    }


    .products-grid.list-view .product-image-container {
        width: 120px;
        height: 130px;
    }


    .products-grid.list-view .product-content {
        grid-template-columns: 1fr auto;
        grid-template-rows: auto auto auto;
        gap: 6px 15px;
    }


    .products-grid.list-view .product-name {
        grid-column: 1;
    }


    .products-grid.list-view .product-price {
        grid-column: 1;
        grid-row: 2;
    }


    .products-grid.list-view .product-stock {
        grid-column: 2;
        grid-row: 1 / span 2;
    }


    .products-grid.list-view .product-actions {
        grid-column: 1 / -1;
        grid-row: 3;
    }
}


/* =========================================================
                           RESPONSIVE - 576px
                           ========================================================= */

@media (max-width: 576px) {
    /* Heading */

    .page-heading {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }


    .heading-actions {
        width: 100%;
        justify-content: space-between;
    }


    .page-heading h1 {
        font-size: 1.8rem;
    }
    /* Search */

    .search-form {
        flex-direction: column;
        align-items: stretch;
        max-width: none;
    }


    .search-button {
        width: 100%;
    }


    .search-result-info {
        flex-wrap: wrap;
    }
    /* Grid */

    .products-grid {
        grid-template-columns: 1fr;
    }


    .product-image-container {
        height: 200px;
    }
    /* List */

    .products-grid.list-view .product-card {
        display: grid;
        grid-template-columns: 90px 1fr;
        height: auto;
        min-height: 120px;
    }


    .products-grid.list-view .product-image-container {
        width: 90px;
        height: 120px;
    }


    .products-grid.list-view .product-content {
        padding: 12px 15px;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }


    .products-grid.list-view .product-name {
        width: 100%;
        font-size: .95rem;
    }


    .products-grid.list-view .product-price {
        font-size: 1.1rem;
    }


    .products-grid.list-view .product-stock {
        display: flex;
        flex-direction: row;
        gap: 5px;
        width: 100%;
        justify-content: flex-start;
    }


    .products-grid.list-view .product-actions {
        width: 100%;
    }


        .products-grid.list-view .product-actions .btn {
            flex: 1;
            font-size: .7rem;
        }


    .view-btn {
        min-width: 75px;
    }
}

