/* Mobile-first responsive stylesheet for Prodavnica */
:root{
  --bg:#f5f5f5;
  --card:#ffffff;
  --accent:#ff9800;
  --muted:#666;
  --text:#222;
}
*{box-sizing:border-box}
html,body{height:100%;margin:0;font-family:Arial,Helvetica,sans-serif;color:var(--text);background:var(--bg);}
header{background:#333;color:#fff;padding:12px 14px;display:flex;align-items:center;justify-content:space-between}
header h1{font-size:18px;margin:0}
nav a{color:inherit;text-decoration:none;margin-left:12px;font-size:14px}
.container{padding:5px 16px;max-width:1100px;margin:0 auto}
.card{background:var(--card);padding:16px;border-radius:8px;box-shadow:0 2px 8px rgba(0,0,0,0.06);}
.grid{display:block}
.product-list{display:grid;grid-template-columns:1fr;gap:12px}
.product-item{display:flex;gap:12px;align-items:center}
.product-item img{width:100px;height:100px;object-fit:contain;border-radius:6px}
.product-info{flex:1}
.price{color:var(--accent);font-weight:700}
.btn{display:inline-block;background:var(--accent);color:#fff;padding:10px 12px;border-radius:6px;border:none;text-decoration:none;text-align:center}
.btn.secondary{background:#333}
.form-row{display:flex;flex-direction:column;gap:8px}
.input,textarea,select{padding:10px;border:1px solid #ddd;border-radius:6px;font-size:14px}
.thumbs{display:flex;gap:8px;flex-wrap:wrap}
.thumbs img{width:64px;height:64px;object-fit:contain;border-radius:6px;cursor:pointer}
/* Larger screens */
@media(min-width:700px){
  header h1{font-size:20px}
  .product-list{grid-template-columns:repeat(2,1fr)}
  .product-detail{display:grid;grid-template-columns:1fr 1fr;gap:24px}
  .product-image{min-height:360px}
}
@media(min-width:1000px){
  .product-list{grid-template-columns:repeat(3,1fr)}
  .product-item img{width:140px;height:140px}
}
/* Accessibility tweaks */
.btn:focus{outline:3px solid rgba(255,152,0,0.25)}
/* Compatibility with existing templates */
.thumbs img.active { opacity:1; border-color:#ff9800; }

/* Mobile: 2 columns */
.products-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:12px;padding:8px 0}
.product-card{background:var(--card);border-radius:8px;overflow:hidden;box-shadow:0 2px 10px rgba(0,0,0,0.08);transition:transform .25s}
.product-card:hover{transform:translateY(-4px)}
.product-image{width:100%;height:auto;display:flex;align-items:center;justify-content:center;background:#fff;overflow:hidden}
.product-image img{width:100%;height:auto;object-fit:contain}
.product-info{padding:10px 10px 0px 10px}
.product-info h3{font-size:14px;margin:0 0 4px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis;line-height:1.3}
.product-info p{color:var(--muted);font-size:13px;margin:0 0 6px}
.product-price{color:var(--accent);font-weight:700;font-size:15px}
.product-actions{display:flex;gap:6px;margin-top:6px}

/* Cart and checkout specific tweaks */
.cart-table{width:100%;border-collapse:collapse}
.cart-table th,.cart-table td{padding:10px;border-bottom:1px solid #eee;text-align:left}

/* Slider styles */
.slider-main {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    overflow: hidden;
}

.slider-main img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.slider-controls {
    position: absolute;
    top: 50%;
    width: 100%;
    display: flex;
    justify-content: space-between;
    transform: translateY(-50%);
    padding: 0 10px;
    pointer-events: none;
}

.slider-controls button {
    background: rgba(0,0,0,0.4);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    pointer-events: auto;
}

@media(min-width:700px){
  .products-grid{grid-template-columns:repeat(2,1fr);gap:14px}
  .product-info{padding:10px}
  .product-info h3{font-size:14px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis;line-height:1.3}
  .product-price{font-size:15px}
}

@media(min-width:768px){
  .products-grid{grid-template-columns:repeat(3,1fr);gap:13px}
  .product-image{min-height:170px}
  .product-info{padding:9px}
  .product-info h3{font-size:13px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis;line-height:1.3}
  .product-price{font-size:14px}
}

@media(min-width:1000px){
  .products-grid{grid-template-columns:repeat(4,1fr);gap:12px}
  .product-image{min-height:180px}
  .product-info{padding:8px}
  .product-info h3{font-size:13px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis;line-height:1.3}
  .product-price{font-size:14px}
}

/* Header styles */
.header-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    background: #333;
    color: #fff;
    padding: 12px 20px;
}

.header-logo {
    flex: 0 0 auto;
    min-width: 50px;
}

.header-logo a {
    display: flex;
    align-items: center;
}

.header-search {
    flex: 1 1 auto;
    display: flex;
    justify-content: center;
    max-width: 500px;
    margin: 0 auto;
}

.search-form {
    display: flex;
    width: 100%;
    gap: 8px;
}

.search-form input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.search-form button {
    background-color: #ff9800;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

.search-form button:hover {
    background-color: #e68900;
}

nav {
    flex: 0 0 auto;
    display: flex;
    gap: 15px;
    align-items: center;
}

/* Responsive header */
@media(max-width: 768px) {
    .header-main {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }
    
    .header-logo {
        flex: 0 0 auto;
    }
    
    .header-search {
        order: 3;
        flex: 0 1 100%;
        max-width: 100%;
    }
    
    .search-form {
        width: 100%;
    }
    
    nav {
        order: 2;
        justify-content: center;
    }
    
    nav a {
        font-size: 13px;
        margin: 0px;
    }
}
/* iOS Safari button fix */
button[type="submit"] {
    -webkit-appearance: none;
    -webkit-user-select: none;
    user-select: none;
    pointer-events: auto;
    cursor: pointer;
}