/**
 * Tazapanier Catalogue - Styles CSS
 * 
 * Charte graphique Tazapanier
 */

/* ====================
   VARIABLES
   ==================== */
:root {
    --tp-brown: #7a5a3a;
    --tp-brown-dark: #362b17;
    --tp-gold: #C9A84C;
    --tp-cream: #F7F3EC;
    --tp-beige: #ede8de;
    --tp-text: #1C1C1C;
    --tp-white: #FFFFFF;
    --tp-green: #22c55e;
    --tp-red: #ef4444;
    --tp-gray: #6b7280;
    --tp-light-gray: #f3f4f6;
    
    --tp-transition: all 0.3s ease;
    --tp-radius: 8px;
    --tp-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --tp-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* ====================
   GRILLE DE PRODUITS
   ==================== */
#tp-products-container {
    position: relative;
}

.tp-products-grid {
    display: grid;
    gap: 4px;
    margin-bottom: 10px;
}

.tp-products-grid.tp-columns-3 {
    grid-template-columns: repeat(3, 1fr);
}

.tp-products-grid.tp-columns-2 {
    grid-template-columns: repeat(2, 1fr);
}

.tp-products-grid.tp-columns-4 {
    grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 1024px) {
    .tp-products-grid.tp-columns-3,
    .tp-products-grid.tp-columns-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .tp-products-grid {
        grid-template-columns: 1fr !important;
    }
}

/* ====================
   CARTE PRODUIT
   ==================== */
.tp-product-card {
    background: var(--tp-white);
    border-radius: var(--tp-radius);
    overflow: hidden;
    box-shadow: var(--tp-shadow);
    transition: var(--tp-transition);
    border: 1px solid var(--tp-beige);
}

.tp-product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--tp-shadow-lg);
}

.tp-product-card-image {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    background: var(--tp-cream);
}

.tp-product-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--tp-transition);
}

.tp-product-card:hover .tp-product-card-image img {
    transform: scale(1.05);
}

.tp-product-badge-id {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--tp-brown);
    color: var(--tp-white);
    padding: 4px 12px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.tp-product-card-content {
    padding: 20px;
}

.tp-product-category {
    display: inline-block;
    color: var(--tp-gold);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.tp-product-name {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 18px;
    font-weight: 600;
    color: var(--tp-text);
    margin: 0 0 8px 0;
    line-height: 1.3;
}

.tp-product-dimensions {
    font-size: 13px;
    color: var(--tp-gray);
    margin: 0 0 12px 0;
}

.tp-product-price {
    font-size: 16px;
    font-weight: 600;
    color: var(--tp-brown);
    margin: 0 0 16px 0;
}

/* ====================
   CONTRÔLES QUANTITÉ
   ==================== */
.tp-product-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.tp-qty-controls {
    display: flex;
    align-items: center;
    border: 1px solid var(--tp-beige);
    border-radius: var(--tp-radius);
    overflow: hidden;
}

.tp-qty-btn {
    width: 16px;
    height: 16px;
    border: none;
    background: var(--tp-cream);
    color: var(--tp-brown);
    font-size: 18px;
    cursor: pointer;
    transition: var(--tp-transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.tp-qty-btn:hover {
    background: var(--tp-beige);
}

.tp-qty-input {
    width: 30px;
    height: 16px;
    border: none;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    color: var(--tp-text);
    background: var(--tp-white);
    -moz-appearance: textfield;
}

.tp-qty-input::-webkit-outer-spin-button,
.tp-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* ====================
   BOUTON AJOUTER AU PANIER
   ==================== */
.tp-add-to-cart {
    flex: 1;
    padding: 10px 16px;
    background: linear-gradient(135deg, var(--tp-brown) 0%, var(--tp-brown-dark) 100%);
    color: var(--tp-white);
    border: none;
    border-radius: var(--tp-radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--tp-transition);
    white-space: nowrap;
}

.tp-add-to-cart:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.tp-add-to-cart.added {
    background: var(--tp-green);
}

/* ====================
   SIDEBAR CATÉGORIES
   ==================== */
.tp-category-sidebar {
    background: var(--tp-white);
    border-radius: var(--tp-radius);
    padding: 24px;
    border: 1px solid var(--tp-beige);
}

.tp-sidebar-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 20px;
    font-weight: 600;
    color: var(--tp-text);
    margin: 0 0 20px 0;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--tp-beige);
}

.tp-category-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.tp-category-item {
    margin-bottom: 4px;
}

.tp-cat-link {
    display: block;
    padding: 10px 12px;
    color: var(--tp-text);
    text-decoration: none;
    border-radius: 4px;
    transition: var(--tp-transition);
    font-size: 14px;
}

.tp-cat-link:hover {
    background: var(--tp-cream);
    color: var(--tp-brown);
}

.tp-cat-link.active {
    background: var(--tp-brown);
    color: var(--tp-white);
}

.tp-cat-link.parent {
    font-weight: 600;
}

.tp-category-children {
    list-style: none;
    margin: 4px 0 4px 16px;
    padding: 0;
    border-left: 2px solid var(--tp-beige);
}

.tp-category-child-item {
    margin: 2px 0;
}

.tp-cat-link.child {
    font-size: 13px;
    padding: 8px 12px;
    color: var(--tp-gray);
}

.tp-cat-link.child:hover,
.tp-cat-link.child.active {
    color: var(--tp-brown);
}

.tp-cat-link.child.active {
    background: var(--tp-cream);
}

/* ====================
   BARRE DE RECHERCHE
   ==================== */
.tp-search-bar {
    display: flex;
    align-items: center;
    background: var(--tp-white);
    border: 1px solid var(--tp-beige);
    border-radius: var(--tp-radius);
    overflow: hidden;
    max-width: 400px;
}

.tp-search-input {
    flex: 1;
    padding: 12px 16px;
    border: none;
    font-size: 14px;
    color: var(--tp-text);
    background: transparent;
}

.tp-search-input:focus {
    outline: none;
}

.tp-search-input::placeholder {
    color: var(--tp-gray);
}

.tp-search-btn {
    padding: 12px 16px;
    background: var(--tp-brown);
    color: var(--tp-white);
    border: none;
    cursor: pointer;
    transition: var(--tp-transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.tp-search-btn:hover {
    background: var(--tp-brown-dark);
}

.tp-results-count {
    margin-top: 12px;
    font-size: 14px;
    color: var(--tp-gray);
}

/* ====================
   PAGINATION
   ==================== */
.tp-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
}

.tp-page-btn {
    min-width: 20px;
    height: 20px;
    padding: 0 12px;
    background: var(--tp-white);
    border: 1px solid var(--tp-beige);
    border-radius: var(--tp-radius);
    color: var(--tp-text);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--tp-transition);
}

.tp-page-btn:hover {
    background: var(--tp-cream);
    border-color: var(--tp-brown);
}

.tp-page-btn.active {
    background: var(--tp-brown);
    border-color: var(--tp-brown);
    color: var(--tp-white);
}

/* ====================
   SPINNER DE CHARGEMENT
   ==================== */
.tp-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
}

.tp-spinner-inner {
    width: 20px;
    height: 20px;
    border: 3px solid var(--tp-beige);
    border-top-color: var(--tp-brown);
    border-radius: 50%;
    animation: tp-spin 0.8s linear infinite;
}

@keyframes tp-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ====================
   MESSAGE AUCUN RÉSULTAT
   ==================== */
.tp-no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--tp-gray);
    font-size: 16px;
}

/* ====================
   BADGE PANIER
   ==================== */
.tp-cart-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: var(--tp-gold);
    color: var(--tp-white);
    font-size: 12px;
    font-weight: 600;
    border-radius: 10px;
    margin-left: 4px;
}

/* ====================
   PAGE PANIER
   ==================== */
.tp-cart-container {
    max-width: 900px;
    margin: 0 auto;
}

.tp-cart-title,
.tp-order-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 28px;
    font-weight: 600;
    color: var(--tp-text);
    margin-bottom: 24px;
}

.tp-cart-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--tp-gray);
}

.tp-cart-empty svg {
    stroke: var(--tp-beige);
    margin-bottom: 20px;
}

.tp-cart-empty p {
    font-size: 16px;
    margin-bottom: 24px;
}

/* ====================
   TABLEAU DU PANIER
   ==================== */
.tp-cart-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.tp-cart-table th {
    text-align: left;
    padding: 16px;
    background: var(--tp-cream);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--tp-gray);
    border-bottom: 2px solid var(--tp-beige);
}

.tp-cart-table td {
    padding: 16px;
    border-bottom: 1px solid var(--tp-beige);
    vertical-align: middle;
}

.tp-cart-product {
    display: flex;
    align-items: center;
    gap: 16px;
}

.tp-cart-product img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
}

.tp-cart-product div {
    display: flex;
    flex-direction: column;
}

.tp-cart-id {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: var(--tp-brown);
    font-weight: 600;
    margin-bottom: 4px;
}

.tp-cart-name {
    font-weight: 500;
    color: var(--tp-text);
}

.tp-cart-qty .tp-qty-controls {
    width: fit-content;
}

.tp-remove-btn {
    background: none;
    border: none;
    color: var(--tp-red);
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: var(--tp-transition);
}

.tp-remove-btn:hover {
    background: #fef2f2;
}

/* ====================
   FORMULAIRE DE COMMANDE
   ==================== */
.tp-order-form-wrapper {
    background: var(--tp-white);
    border-radius: var(--tp-radius);
    padding: 32px;
    border: 1px solid var(--tp-beige);
}

.tp-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .tp-form-row {
        grid-template-columns: 1fr;
    }
}

.tp-form-group {
    margin-bottom: 20px;
}

.tp-form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--tp-text);
    margin-bottom: 8px;
}

.tp-form-group label .required {
    color: var(--tp-red);
}

.tp-form-group input,
.tp-form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--tp-beige);
    border-radius: var(--tp-radius);
    font-size: 14px;
    color: var(--tp-text);
    background: var(--tp-white);
    transition: var(--tp-transition);
}

.tp-form-group input:focus,
.tp-form-group textarea:focus {
    outline: none;
    border-color: var(--tp-brown);
}

.tp-form-group input::placeholder,
.tp-form-group textarea::placeholder {
    color: var(--tp-gray);
}

.tp-form-actions {
    display: flex;
    gap: 16px;
    margin-top: 24px;
}

@media (max-width: 768px) {
    .tp-form-actions {
        flex-direction: column;
    }
}

/* ====================
   BOUTONS
   ==================== */
.tp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border-radius: var(--tp-radius);
    cursor: pointer;
    transition: var(--tp-transition);
    border: none;
}

.tp-btn-primary {
    background: linear-gradient(135deg, var(--tp-brown) 0%, var(--tp-brown-dark) 100%);
    color: var(--tp-white);
}

.tp-btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.tp-btn-secondary {
    background: var(--tp-white);
    color: var(--tp-brown);
    border: 1px solid var(--tp-brown);
}

.tp-btn-secondary:hover {
    background: var(--tp-cream);
}

.tp-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ====================
   MESSAGES DU FORMULAIRE
   ==================== */
.tp-form-messages {
    margin-top: 24px;
}

.tp-form-success,
.tp-form-error {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-radius: var(--tp-radius);
    font-size: 14px;
}

.tp-form-success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.tp-form-success svg {
    stroke: var(--tp-green);
    flex-shrink: 0;
}

.tp-form-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.tp-form-error svg {
    stroke: var(--tp-red);
    flex-shrink: 0;
}

.tp-form-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 20px;
    color: var(--tp-gray);
}

/* ====================
   NOTIFICATION
   ==================== */
.tp-notification {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--tp-brown);
    color: var(--tp-white);
    padding: 16px 24px;
    border-radius: var(--tp-radius);
    font-size: 14px;
    font-weight: 500;
    box-shadow: var(--tp-shadow-lg);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 9999;
}

.tp-notification.show {
    transform: translateY(0);
    opacity: 1;
}

/* ====================
   LAYOUT CATALOGUE
   ==================== */
.tp-catalog-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 32px;
}

@media (max-width: 1024px) {
    .tp-catalog-layout {
        grid-template-columns: 1fr;
    }
    
    .tp-category-sidebar {
        order: -1;
    }
}
