/* =========================================
   iPhone World - Feuille de style globale
   ========================================= */

/* --- Base --- */
body {
    font-family: 'Inter', sans-serif;
    background: #f5f5f7;
    color: #1d1d1f;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
main { flex: 1; padding: 60px 0; }
footer { background: #1d1d1f; color: #a1a1a6; font-size: .85rem; }

/* --- Navbar --- */
.navbar {
    background: rgba(255,255,255,0.85) !important;
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0,0,0,0.08);
}
.navbar-brand { color: #1d1d1f !important; font-weight: 700; }
.nav-link { color: #444 !important; font-size: .9rem; }
.nav-link:hover { color: #667eea !important; }

/* --- Formulaires --- */
.form-control { border-radius: 12px; border: 1.5px solid #e0e0e5; padding: 12px 16px; }
.form-control:focus { border-color: #667eea; box-shadow: 0 0 0 3px rgba(102,126,234,.12); }
.form-label { font-weight: 500; font-size: .9rem; margin-bottom: 6px; }

/* --- Bouton principal (gradient) --- */
.btn-main,
.btn-buy,
.btn-checkout,
.btn-order,
.btn-shop,
.btn-back-shop {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border: none;
    border-radius: 14px;
    padding: 13px;
    font-weight: 600;
    color: white;
    width: 100%;
    font-size: 1rem;
    transition: opacity .2s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}
.btn-main:hover,
.btn-buy:hover,
.btn-checkout:hover,
.btn-order:hover,
.btn-shop:hover,
.btn-back-shop:hover { opacity: .85; color: white; }
.btn-buy:disabled,
.btn-checkout:disabled { opacity: .4; }

/* --- Badges promo --- */
.promo-badge {
    background: #ff3b30;
    color: white;
    font-size: .78rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 20px;
    letter-spacing: .03em;
}
.original-price {
    font-size: .9rem;
    color: #a1a1a6;
    text-decoration: line-through;
    font-weight: 400;
    margin-right: 4px;
}

/* =========================================
   Page d'accueil (products.php)
   ========================================= */
.hero-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 90px 0 70px;
    clip-path: polygon(0 0, 100% 0, 100% 88%, 0 100%);
    margin-bottom: 20px;
}
.hero-section h1 { font-size: 3rem; font-weight: 700; }
.hero-section p { opacity: .85; font-size: 1.15rem; }

.section-title {
    font-size: 1.9rem;
    font-weight: 700;
    position: relative;
    display: inline-block;
    margin-bottom: 40px;
}
.section-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 48px;
    height: 3px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 2px;
}

.card {
    position: relative;
    border: none;
    border-radius: 20px;
    background: white;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    transition: transform .25s ease, box-shadow .25s ease;
}
.card:hover { transform: translateY(-6px); box-shadow: 0 12px 28px rgba(0,0,0,0.12); }
.card-img-top { height: 260px; object-fit: contain; padding: 24px 24px 0; }
.card-body { padding: 20px 24px 24px; }
.card-title { font-size: 1.05rem; font-weight: 700; margin-bottom: 4px; }
.card-desc { font-size: .85rem; color: #6e6e73; margin-bottom: 16px; }
.price { font-size: 1.3rem; font-weight: 700; color: #1d1d1f; margin-bottom: 14px; }

.promo-badge-card {
    position: absolute;
    top: 14px;
    left: 14px;
    z-index: 1;
}

.btn-details {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border: none;
    border-radius: 12px;
    padding: 10px;
    font-size: .9rem;
    font-weight: 600;
    color: white;
    width: 100%;
    transition: opacity .2s, transform .2s;
    text-decoration: none;
    display: block;
    text-align: center;
}
.btn-details:hover { opacity: .85; transform: translateY(-1px); color: white; }

/* =========================================
   Page détail produit (product_detail.php)
   ========================================= */
.product-section { flex: 1; padding: 70px 0 80px; }
.product-image {
    background: white;
    border-radius: 24px;
    padding: 48px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.07);
    text-align: center;
}
.product-image img { max-width: 100%; height: auto; max-height: 380px; object-fit: contain; }
.product-info { padding: 10px 20px; }
.product-title { font-size: 2.6rem; font-weight: 700; color: #1d1d1f; margin-bottom: 8px; }
.product-desc { color: #6e6e73; font-size: 1rem; margin-bottom: 28px; }
.product-price { font-size: 2.2rem; font-weight: 700; color: #1d1d1f; margin-bottom: 8px; }

.specs-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; margin-bottom: 30px; }
.spec-item { background: white; border-radius: 14px; padding: 16px 12px; text-align: center; box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
.spec-label { font-size: .72rem; color: #6e6e73; display: block; margin-bottom: 2px; text-transform: uppercase; letter-spacing: .04em; }
.spec-value { font-size: .9rem; font-weight: 600; color: #1d1d1f; }

.stock-badge { display: inline-block; padding: 5px 14px; border-radius: 20px; font-size: .82rem; font-weight: 500; margin-bottom: 20px; }
.in-stock { background: #d1fae5; color: #065f46; }
.out-stock { background: #fee2e2; color: #991b1b; }

.btn-back {
    width: 100%;
    border-radius: 14px;
    padding: 12px;
    font-size: .95rem;
    border: 1.5px solid #d1d1d6;
    color: #444;
    background: white;
    text-decoration: none;
    display: block;
    text-align: center;
    margin-top: 10px;
}
.btn-back:hover { border-color: #667eea; color: #667eea; }

/* =========================================
   Panier (cart/index.php)
   ========================================= */
.cart-card { background: white; border-radius: 20px; box-shadow: 0 4px 24px rgba(0,0,0,0.07); overflow: hidden; }
.cart-item { display: flex; align-items: center; gap: 20px; padding: 20px 24px; border-bottom: 1px solid #f0f0f2; }
.cart-item:last-child { border-bottom: none; }
.cart-item img { width: 80px; height: 80px; object-fit: contain; background: #f5f5f7; border-radius: 12px; padding: 8px; }
.item-name { font-weight: 600; margin-bottom: 4px; }
.item-price { color: #6e6e73; font-size: .9rem; }
.qty-input { width: 60px; text-align: center; border: 1.5px solid #e0e0e5; border-radius: 10px; padding: 6px; font-size: .9rem; }
.btn-remove { background: none; border: none; color: #a1a1a6; font-size: .85rem; cursor: pointer; text-decoration: none; }
.btn-remove:hover { color: #ff3b30; }

.summary-card { background: white; border-radius: 20px; box-shadow: 0 4px 24px rgba(0,0,0,0.07); padding: 28px; }
.total-row { display: flex; justify-content: space-between; padding: 10px 0; font-size: .95rem; }
.total-row.final { font-size: 1.2rem; font-weight: 700; border-top: 1.5px solid #f0f0f2; margin-top: 8px; padding-top: 16px; }
.empty-cart { text-align: center; padding: 80px 20px; color: #6e6e73; }

/* =========================================
   Checkout (order/checkout.php)
   ========================================= */
.form-card { background: white; border-radius: 24px; box-shadow: 0 4px 24px rgba(0,0,0,0.07); padding: 40px; }
.order-row { display: flex; justify-content: space-between; padding: 8px 0; font-size: .9rem; border-bottom: 1px solid #f0f0f2; }
.order-row:last-of-type { border: none; }
.total-final { display: flex; justify-content: space-between; font-size: 1.15rem; font-weight: 700; border-top: 1.5px solid #f0f0f2; padding-top: 14px; margin-top: 8px; }

/* =========================================
   Confirmation commande (order/confirm.php)
   ========================================= */
.confirm-card { background: white; border-radius: 24px; box-shadow: 0 4px 24px rgba(0,0,0,0.07); padding: 50px 40px; text-align: center; max-width: 520px; margin: 0 auto; }
.check-icon { width: 72px; height: 72px; background: #d1fae5; color: #065f46; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 24px; font-size: 1rem; font-weight: 700; }
.confirm-card h2 { font-weight: 700; margin-bottom: 8px; }
.confirm-card .subtitle { color: #6e6e73; margin-bottom: 28px; }
.info-row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid #f0f0f2; font-size: .9rem; }
.info-row:last-of-type { border: none; font-weight: 700; font-size: 1rem; }
.btn-confirm-back { background: linear-gradient(135deg, #667eea, #764ba2); border: none; border-radius: 14px; padding: 13px 32px; font-weight: 600; color: white; text-decoration: none; display: inline-block; margin-top: 28px; transition: opacity .2s; }
.btn-confirm-back:hover { opacity: .85; color: white; }

/* =========================================
   Mes commandes (order/my_orders.php)
   ========================================= */
.page-title { font-weight: 700; font-size: 1.8rem; margin-bottom: 8px; }
.page-sub { color: #6e6e73; margin-bottom: 32px; }
.order-card { background: white; border-radius: 20px; box-shadow: 0 2px 16px rgba(0,0,0,0.06); padding: 28px; margin-bottom: 20px; }
.order-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; flex-wrap: wrap; gap: 8px; }
.order-id { font-weight: 700; font-size: 1rem; }
.order-date { color: #6e6e73; font-size: .85rem; }
.order-total { font-weight: 700; font-size: 1.05rem; color: #667eea; }
.badge-confirmed { background: #d1fae5; color: #065f46; font-size: .78rem; font-weight: 600; padding: 4px 12px; border-radius: 20px; }
.orders-table { width: 100%; font-size: .9rem; }
.orders-table th { color: #6e6e73; font-weight: 500; border-bottom: 1px solid #f0f0f2; padding: 6px 0; }
.orders-table td { padding: 8px 0; border-bottom: 1px solid #f8f8fa; }
.orders-table tr:last-child td { border: none; }
.empty-box { text-align: center; padding: 60px 20px; background: white; border-radius: 20px; }

/* =========================================
   Contact (contact.php)
   ========================================= */
.contact-section { flex: 1; padding: 70px 0 80px; }
.contact-card { background: white; border-radius: 24px; padding: 48px; box-shadow: 0 4px 24px rgba(0,0,0,0.07); max-width: 600px; margin: 0 auto; }
.contact-card h1 { font-size: 2rem; font-weight: 700; margin-bottom: 6px; }
.contact-card .subtitle { color: #6e6e73; font-size: .95rem; margin-bottom: 36px; }
.contact-info-row { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid #f0f0f2; font-size: .9rem; color: #444; }
.contact-info-row:last-child { border-bottom: none; }
.info-icon { font-size: .8rem; font-weight: 600; color: #667eea; min-width: 70px; }

/* =========================================
   Connexion / Inscription (user/login.php, register.php)
   ========================================= */
.auth-main { flex: 1; display: flex; align-items: center; padding: 60px 0; }
.auth-card { border: none; border-radius: 24px; box-shadow: 0 4px 24px rgba(0,0,0,0.07); padding: 40px; }
.auth-card h2 { font-weight: 700; margin-bottom: 6px; }
.auth-card .subtitle { color: #6e6e73; font-size: .9rem; margin-bottom: 28px; }
